DateTime sDate;
DateTime eDate;
string strDtFrom=string.Empty;
string strDtTo=string.Empty;
dValueSum = Convert.ToDouble(dtForIncorrectData.AsEnumerable()
.Where(y => y.Field<string>("Date").Equals(strDtFrom)
&& y.Field<decimal>("Value") > 0)
.Sum(x => x.Field<decimal>("Value"))
.ToString());
var query = (from s in dtFormatedCmbFinal.AsEnumerable()
where (s.Field<string>("Date").Equals(strDtFrom))
select new
{
dValue = s.Field<decimal>("Value")
}).Distinct();
dValue = Convert.ToDouble(query.ElementAt(0).dValue);
int rowCountforSameDate = 0;
rowCountforSameDate = dtForIncorrectData.AsEnumerable()
.Count(row => row.Field<string>("Date").Equals(strDtTemp));
strDtFrom = dtForIncorrectData.Rows[0]["Date"].ToString();
strDtTo = dtForIncorrectData.Rows[dtForIncorrectData.Rows.Count - 1]["Date"].ToString();
DateTime.TryParseExact(strDtFrom, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out sDate);
DateTime.TryParseExact(strDtTo, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out eDate);
dtpFromDate.Value = sDate;
dtpToDate.Value = eDate;
DateTime eDate;
string strDtFrom=string.Empty;
string strDtTo=string.Empty;
dValueSum = Convert.ToDouble(dtForIncorrectData.AsEnumerable()
.Where(y => y.Field<string>("Date").Equals(strDtFrom)
&& y.Field<decimal>("Value") > 0)
.Sum(x => x.Field<decimal>("Value"))
.ToString());
var query = (from s in dtFormatedCmbFinal.AsEnumerable()
where (s.Field<string>("Date").Equals(strDtFrom))
select new
{
dValue = s.Field<decimal>("Value")
}).Distinct();
dValue = Convert.ToDouble(query.ElementAt(0).dValue);
int rowCountforSameDate = 0;
rowCountforSameDate = dtForIncorrectData.AsEnumerable()
.Count(row => row.Field<string>("Date").Equals(strDtTemp));
strDtFrom = dtForIncorrectData.Rows[0]["Date"].ToString();
strDtTo = dtForIncorrectData.Rows[dtForIncorrectData.Rows.Count - 1]["Date"].ToString();
DateTime.TryParseExact(strDtFrom, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out sDate);
DateTime.TryParseExact(strDtTo, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out eDate);
dtpFromDate.Value = sDate;
dtpToDate.Value = eDate;
No comments:
Post a Comment