protected void LoadBirdPrice() { int Day = int.Parse(ddlDays.SelectedValue.Trim()); int Month = int.Parse(ddlMonth.SelectedValue.Trim()); int Year = int.Parse(ddlYear.SelectedValue.Trim()); //string SDate = (Month + "/" + Day + "/" + Year).ToString(); string SDate = (Year + "-" + Month + "-" + Day).ToString(); DateTime DDate = Convert.ToDateTime(SDate); BusinessLayer.SMS.BirdPrice ObjBirdPrice = new BusinessLayer.SMS.BirdPrice(); DataTable dt = ObjBirdPrice.GetAll(DDate); if (dt != null) { dgvBirdPrice.DataSource = dt; dgvBirdPrice.DataBind(); } else { } BusinessLayer.SMS.EggPrice ObjEggPrice = new BusinessLayer.SMS.EggPrice(); Entity.SMS.EggPrice EggPrice = new Entity.SMS.EggPrice(); EggPrice = ObjEggPrice.GetAllById(DDate); if (EggPrice != null) { txtNECCEggRate.Text = EggPrice.NECCPrice.ToString(); txtbelowWt.Text = EggPrice.belowWt.ToString(); txtoverWt.Text = EggPrice.overWt.ToString(); txtbelowAddRate.Text = EggPrice.belowAddRate.ToString(); txtoverAddRate.Text = EggPrice.overAddRate.ToString(); } }
protected String BStrMssg() { int Day = int.Parse(ddlDays.SelectedValue.Trim()); int Month = int.Parse(ddlMonth.SelectedValue.Trim()); int Year = int.Parse(ddlYear.SelectedValue.Trim()); string districtDetails = ""; //string SDate = (Month + "/" + Day + "/" + Year).ToString(); string SDate = (Year + "-" + Month + "-" + Day).ToString(); DateTime DDate = Convert.ToDateTime(SDate); StringBuilder StrMssg = new StringBuilder(); string Str1 = "WBPF Broiler suggested rate for " + DDate.ToString("dd/MM/yyyy") + "\n"; StrMssg.Append(Str1); BusinessLayer.SMS.BirdPrice ObjBirdPrice = new BusinessLayer.SMS.BirdPrice(); DataTable dt = ObjBirdPrice.GetAll(DDate); if (Mssg == "") { foreach (DataRow dr in dt.Rows) { districtDetails = dr["DistrictName"].ToString() + "-" + dr["FarmRate"].ToString() + "/" + dr["RetailerRate"].ToString() + "/" + dr["BroilerRate"].ToString() + "/" + dr["DressedRate"].ToString() + "\n"; StrMssg.Append(districtDetails); } BusinessLayer.SMS.EggPrice ObjEggPrice = new BusinessLayer.SMS.EggPrice(); Entity.SMS.EggPrice Eggprice = new Entity.SMS.EggPrice(); Eggprice = ObjEggPrice.GetAllById(DDate); //string Str2 = "Bird weight below" + Eggprice.belowWt.ToString() + "kg.=Dist.rate plus Rs." + Eggprice.belowAddRate.ToString() + ".NECC egg rate-" + Eggprice.NECCPrice.ToString(); string Str2 = "Bird weight below " + Eggprice.belowWt.ToString() + "kg.=Dist.rate plus Rs." + Eggprice.belowAddRate.ToString() + ". NECC egg rate " + Eggprice.NECCPrice.ToString(); StrMssg.Append(Str2); txtMssg.Text = StrMssg.ToString(); } else { Mssg = txtMssg.Text; } return(Mssg); }