Ejemplo n.º 1
0
        public int RechillingData(MRechilling receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("@RMRId", receive.RMRId));
                paramcollection.Add(new DBParameter("@QualityId", receive.QualityId));
                paramcollection.Add(new DBParameter("@BatchNo", receive.BatchNo));
                paramcollection.Add(new DBParameter("@ShiftId", receive.ShiftId));
                paramcollection.Add(new DBParameter("@Date", receive.Date));
                paramcollection.Add(new DBParameter("@SiloId", receive.SiloNo));
                paramcollection.Add(new DBParameter("@TypeOfMilk", receive.TypeOfMilk));
                paramcollection.Add(new DBParameter("@Qty", receive.Quantity));
                paramcollection.Add(new DBParameter("@IBTInTemperature", receive.IBTInTemperature));
                paramcollection.Add(new DBParameter("@IBTOutTemperature", receive.IBTOutTemperature));
                paramcollection.Add(new DBParameter("@MilkInTemperature", receive.MilkInTemperature));
                paramcollection.Add(new DBParameter("@MilkOutTemperature", receive.MilkOutTemperature));
                paramcollection.Add(new DBParameter("@RechilledBy", receive.RechilledBy));
                paramcollection.Add(new DBParameter("@RechillStatusId", receive.RechillStatusId));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("sp_Prod_RechillingDetails", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                string MSG = EX.ToString();
            }
            return(result);
        }
Ejemplo n.º 2
0
        protected void btnAddRechilling_Click(object sender, EventArgs e)
        {
            RData = new MRechilling();
            BData = new BRechilling();
            int Result = 0;

            RData.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
            foreach (RepeaterItem item in rpRechillingList.Items)
            {
                HiddenField hdfID2 = item.FindControl("hfQualityId") as HiddenField;
                if (hdfID2 != null)
                {
                    RData.QualityId = string.IsNullOrEmpty(hdfID2.Value) ? 0 : Convert.ToInt32(hdfID2.Value);
                }
            }
            RData.BatchNo    = string.IsNullOrEmpty(txtBatchNO.Text) ? string.Empty : txtBatchNO.Text;
            RData.ShiftId    = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            RData.Date       = Convert.ToDateTime(txtDate.Text.ToString());
            RData.SiloNo     = Convert.ToInt32(txtSiloNo.Text);
            RData.TypeOfMilk = dpTypeOfMilk.SelectedItem.Text;
            //string.IsNullOrEmpty(txtTypeOfMilk.Text) ? string.Empty : txtTypeOfMilk.Text;
            RData.Quantity           = Convert.ToDouble(txtQuantity.Text);
            RData.IBTInTemperature   = Convert.ToDouble(txtIBTInTemperature.Text);
            RData.IBTOutTemperature  = Convert.ToDouble(txtIBTOutTemperature.Text);
            RData.MilkInTemperature  = Convert.ToDouble(txtMilkInTemperature.Text);
            RData.MilkOutTemperature = Convert.ToDouble(txtMilkOutTemperature.Text);
            RData.RechilledBy        = string.IsNullOrEmpty(txtRechilledBy.Text) ? string.Empty : txtRechilledBy.Text;
            RData.RechillStatusId    = Convert.ToInt32(dpRechillStatus.SelectedItem.Value);
            RData.flag = "Insert";
            Result     = BData.RechillingData(RData);
            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;

                ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true);

                //string dates;
                //dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy");
                //GetReachlingDetails(dates);
                RMRecieve R = new RMRecieve();
                R.RMRDate = Convert.ToDateTime(txtDate.Text);
                GetReachlingDetails(R);
                uprouteList.Update();
                lblSuccess.Text = "Rechilling Data Add  Successfully";
                pnlError.Update();
                ClearTextbox();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }

            //return Result;
        }
Ejemplo n.º 3
0
        public int RechillingData(MRechilling receive)
        {
            darechilling = new DARechilling();
            int Result = 0;

            try
            {
                Result = darechilling.RechillingData(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
Ejemplo n.º 4
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            {
                MRechilling RData  = new MRechilling();
                BRechilling BData  = new BRechilling();
                int         Result = 0;
                RData.RMRId      = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
                RData.BatchNo    = string.IsNullOrEmpty(txtBatchNO.Text) ? string.Empty : txtBatchNO.Text;
                RData.ShiftId    = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                RData.Date       = Convert.ToDateTime(txtDate.Text.ToString());
                RData.SiloNo     = Convert.ToInt32(txtSiloNo.Text);
                RData.TypeOfMilk = dpTypeOfMilk.SelectedItem.Text;
                //string.IsNullOrEmpty(txtTypeOfMilk.Text) ? string.Empty : txtTypeOfMilk.Text;
                RData.Quantity           = Convert.ToDouble(txtQuantity.Text);
                RData.IBTInTemperature   = Convert.ToDouble(txtIBTInTemperature.Text);
                RData.IBTOutTemperature  = Convert.ToDouble(txtIBTOutTemperature.Text);
                RData.MilkInTemperature  = Convert.ToDouble(txtMilkInTemperature.Text);
                RData.MilkOutTemperature = Convert.ToDouble(txtMilkOutTemperature.Text);
                RData.RechilledBy        = string.IsNullOrEmpty(txtRechilledBy.Text) ? string.Empty : txtRechilledBy.Text;
                RData.RechillStatusId    = Convert.ToInt32(dpRechillStatus.SelectedItem.Value);
                RData.flag = "Update";

                Result = BData.RechillingData(RData);
                if (Result > 0)
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = false;
                    divSusccess.Visible = true;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true);
                    RMRecieve R = new RMRecieve();
                    R.RMRDate = Convert.ToDateTime(txtDate.Text);
                    GetReachlingDetails(R);
                    uprouteList.Update();
                    lblSuccess.Text = "Rechilling Data Updated  Successfully";
                    pnlError.Update();
                    ClearTextbox();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblSuccess.Text     = "Something went wrong plz contact site admin";
                    pnlError.Update();
                }
            }
        }