예제 #1
0
        protected String BStrMssg()
        {
            int    Day             = int.Parse(ddlDay.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" + "Farmer,PTR,Retailer(Whole Bird/Dressed Bird)" + "\n";

            StrMssg.Append(Str1);

            BusinessLayer.Common.BirdPrice ObjBirdPrice = new BusinessLayer.Common.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.Common.EggPrice ObjEggPrice = new BusinessLayer.Common.EggPrice();
                Entity.Common.EggPrice        Eggprice    = new Entity.Common.EggPrice();
                Eggprice = ObjEggPrice.GetAllById(DDate);


                // string Str2 = "Bird weight below " + Eggprice.belowWt.ToString() + "kg.=Dist.rate plus Rs." + Eggprice.belowAddRate.ToString() + ".Bird weight upto(1.1kg-1.3kg)=Dist.rate plus Rs." + Eggprice.overAddRate.ToString() + ".NECC Egg Rate:SB-" + Eggprice.NECCPrice.ToString() + ",NAD-" + Eggprice.NECCPrice2.ToString() + ",NB-" + Eggprice.NECCPrice3.ToString();

                string Str2 = "Bird weight below " + Eggprice.belowWt.ToString() + "kg.=Dist.rate plus Rs." + Eggprice.belowAddRate.ToString() + ".NECC WEST BENGAL Egg Rate of " + DDate.ToString("dd/MM/yyyy") + " Rs. " + Eggprice.NECCPrice.ToString();

                // Bird weight below 1.2kg.= Dist.rate plus Rs.20.00.NECC WEST BENGAL Egg Rate of 09.03.2021 Rs.4.53



                StrMssg.Append(Str2);

                txtMessageBody.Text = StrMssg.ToString();
            }
            else
            {
                Mssg = txtMessageBody.Text;
            }

            return(Mssg);
        }
예제 #2
0
        protected void LoadBirdPrice()
        {
            int Day   = int.Parse(ddlDay.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.Common.BirdPrice ObjBirdPrice = new BusinessLayer.Common.BirdPrice();
            DataTable dt = ObjBirdPrice.GetAll(DDate);

            if (dt != null)
            {
                dgvBirdPrice.DataSource = dt;
                dgvBirdPrice.DataBind();
            }
            else
            {
            }

            BusinessLayer.Common.EggPrice ObjEggPrice = new BusinessLayer.Common.EggPrice();
            Entity.Common.EggPrice        EggPrice    = new Entity.Common.EggPrice();
            EggPrice = ObjEggPrice.GetAllById(DDate);

            if (EggPrice != null)
            {
                txtNECCEggRate.Text  = EggPrice.NECCPrice.ToString();
                txtNECCEggRate2.Text = EggPrice.NECCPrice2.ToString();
                txtNECCEggRate3.Text = EggPrice.NECCPrice3.ToString();
                txtbelowWt.Text      = EggPrice.belowWt.ToString();
                txtoverWt.Text       = EggPrice.overWt.ToString();
                txtbelowAddRate.Text = EggPrice.belowAddRate.ToString();
                txtoverAddRate.Text  = EggPrice.overAddRate.ToString();
            }
        }