예제 #1
0
        public void GetCreamDetails(string dates)
        {
            bcream = new BCreamProduction();
            DataSet DS = new DataSet();

            DS = bcream.GetCreamDetails(dates);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpCreamProduction.DataSource = DS;
                rpCreamProduction.DataBind();
            }
            else
            {
                DS.Clear();
                rpCreamProduction.DataSource = DS;
                rpCreamProduction.DataBind();
            }
        }
예제 #2
0
        public void GetCreamDetails(RMRecieve R)
        {
            bcream = new BCreamProduction();
            DataSet DS = new DataSet();

            DS = bcream.GetCreamDetails(R);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpCreamProduction.DataSource = DS;
                rpCreamProduction.DataBind();
            }
            else if (DS.Tables[0].Rows.Count == 0)
            {
                //this.BindRepeater(dt);
                rpCreamProduction.DataSource = DS;
                rpCreamProduction.DataBind();
            }
        }
예제 #3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            {
                mcream = new MCreamProduction();
                bcream = new BCreamProduction();
                int Result = 0;
                mcream.CreamProductionId      = 0;
                mcream.RMRId                  = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
                mcream.CreamProductionDate    = Convert.ToDateTime(txtDate.Text).ToString("dd-MM-yyyy");
                mcream.CreamProductionShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                mcream.BatchCodeCream         = string.IsNullOrEmpty(txtBatchCodeCream.Text) ? string.Empty : txtBatchCodeCream.Text;
                mcream.FAT           = string.IsNullOrEmpty(txtFAT.Text) ? 0 : Convert.ToDouble(txtFAT.Text);
                mcream.CreamQty      = string.IsNullOrEmpty(txtCreamQty.Text) ? 0 : Convert.ToDouble(txtCreamQty.Text);
                mcream.CreamStatusId = Convert.ToInt32(dpCreamProductionDone.SelectedItem.Value);
                mcream.flag          = "Insert";
                Result = bcream.creamdata(mcream);
                if (Result > 0)
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = false;
                    divSusccess.Visible = true;
                    lblSuccess.Text     = "PasteurizationProcess Data Add  Successfully";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true);
                    pnlError.Update();
                    //string dates;
                    //dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy");
                    //GetCreamDetails(dates);
                    RMRecieve R = new RMRecieve();
                    R.RMRDate = Convert.ToDateTime(txtDate.Text);
                    GetCreamDetails(R);
                    uprouteList.Update();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblSuccess.Text     = "Something went wrong plz contact site admin";
                    pnlError.Update();
                }

                //return Result;
            }
        }
예제 #4
0
        public void GetCreamDetails(int RMRId)
        {
            DataSet DS = new DataSet();

            bcream = new BCreamProduction();
            DS     = bcream.GetCreamDetailsbyId(RMRId);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                string DATE = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CreamProductionDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CreamProductionDate"].ToString();
                //sky
                if (DATE == "")
                {
                    txtDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
                }
                else
                {
                    DateTime date1 = Convert.ToDateTime(DATE, System.Globalization.CultureInfo.GetCultureInfo("ur-PK").DateTimeFormat);
                    txtDate.Text = (Convert.ToDateTime(date1).ToString("yyyy-MM-dd"));
                }
                txtBatchNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BatchNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BatchNo"].ToString();
                dpShiftDetails.ClearSelection();
                try
                {
                    if (dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["CreamProductionShiftId"]).ToString()) != null)
                    {
                        dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["CreamProductionShiftId"]).ToString()).Selected = true;
                    }
                }
                catch (InvalidCastException)
                {
                    dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["PastQCShiftId"]).ToString()).Selected = true;

                    //dpShiftDetails.SelectedIndex = 0;
                }
                txtBatchCodeCream.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BatchCodeCream"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BatchCodeCream"].ToString();
                txtCreamQty.Text       = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CreamQty"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CreamQty"].ToString();
                txtFAT.Text            = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FAT"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FAT"].ToString();
            }
        }