Пример #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            {
                mhomo = new MHomogenizer();
                bhomo = new BHomogenizer();
                int Result = 0;
                mhomo.HomogenizerId      = 0;
                mhomo.RMRId              = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
                mhomo.HomogenizerDate    = Convert.ToDateTime(txtHomogenizerDate.Text.ToString());
                mhomo.HomogenizerShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                //mhomo.StatusId = Convert.ToInt32(dpStatusDetails.SelectedItem.Value);
                mhomo.PressureFirstStage  = string.IsNullOrEmpty(txtPressureFisrtStage.Text) ? 0 : Convert.ToDouble(txtPressureFisrtStage.Text);
                mhomo.PressureSecondStage = string.IsNullOrEmpty(txtPressureSecondStage.Text) ? 0 : Convert.ToDouble(txtPressureSecondStage.Text);
                // mhomo.Oilleakage = string.IsNullOrEmpty(txtOilleakage.Text) ? 0 : Convert.ToDouble(txtOilleakage.Text);

                mhomo.OilleakageId = Convert.ToInt32(dpOilLeakage.SelectedItem.Value);

                mhomo.HomogenizedQty = string.IsNullOrEmpty(txtQtyHomogenized.Text) ? 0 : Convert.ToDouble(txtQtyHomogenized.Text);
                mhomo.Technician     = txtTechnician.Text;
                //mhomo.Homogenized = txtHomogenized.Text;
                mhomo.Remarks             = txtRemarks.Text;
                mhomo.MachineStartTime    = txtStartingTime.Text;
                mhomo.MachineEndTime      = txtEndTime.Text;
                mhomo.Technician          = txtTechnician.Text;
                mhomo.HomogenizerStatusId = Convert.ToInt32(dpStatusDetails.SelectedItem.Value);
                mhomo.flag = "Update";
                Result     = bhomo.homodata(mhomo);
                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");
                    //GetHomogenizerDetails(dates);
                    RMRecieve R = new RMRecieve();
                    R.RMRDate = Convert.ToDateTime(txtSearchDate.Text);
                    GetHomogenizerDetails(R);
                    uprouteList.Update();
                    lblSuccess.Text = "Homogenizer Data Update  Successfully";
                    pnlError.Update();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblSuccess.Text     = "Something went wrong plz contact site admin";
                    pnlError.Update();
                }

                //return Result;
            }
        }
Пример #2
0
        public void GetHomogenizerDetails(string dates)
        {
            bhomo = new BHomogenizer();
            DataSet DS = new DataSet();

            DS = bhomo.GetHomogenizerDetails(dates);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpHomogenizer.DataSource = DS;
                rpHomogenizer.DataBind();
            }
            else
            {
                DS.Clear();
                rpHomogenizer.DataSource = DS;
                rpHomogenizer.DataBind();
            }
        }
Пример #3
0
        public void GetHomogenizerDetails(RMRecieve R)
        {
            bhomo = new BHomogenizer();
            DataSet DS = new DataSet();

            DS = bhomo.GetHomogenizerDetails(R);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                rpHomogenizer.DataSource = DS;
                rpHomogenizer.DataBind();
            }
            else if (DS.Tables[0].Rows.Count == 0)
            {
                //this.BindRepeater(dt);
                rpHomogenizer.DataSource = DS;
                rpHomogenizer.DataBind();
            }
        }
Пример #4
0
        public void GetHomogenizerDetails(int RMRId)
        {
            DataSet DS = new DataSet();

            bhomo = new BHomogenizer();
            DS    = bhomo.GetHomogenizerDetailsById(RMRId);
            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                string DATE = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["HomogenizerDate"].ToString()) ? string.Empty : Convert.ToDateTime(DS.Tables[0].Rows[0]["HomogenizerDate"]).ToString("yyyy-MM-dd");
                if (DATE == "")
                {
                    txtHomogenizerDate.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd"));
                }
                else
                {
                    txtHomogenizerDate.Text = DATE;
                }
                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]["HomogenizerShiftId"]).ToString()) != null)
                    {
                        dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["HomogenizerShiftId"]).ToString()).Selected = true;
                    }
                }
                catch (InvalidCastException)
                {
                    dpShiftDetails.SelectedIndex = 0;
                }
                //dpStatusDetails.ClearSelection();
                //if (dpStatusDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["StatusId"]).ToString()) != null)
                //{
                //    dpStatusDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["StatusId"]).ToString()).Selected = true;
                //}
                txtPressureFisrtStage.Text  = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["PressureFirstStage"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["PressureFirstStage"].ToString();
                txtPressureSecondStage.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["PressureSecondStage"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["PressureSecondStage"].ToString();
                //txtOilleakage.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Oilleakage"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Oilleakage"].ToString();
                dpOilLeakage.ClearSelection();
                try
                {
                    if (dpOilLeakage.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["OilleakageId"]).ToString()) != null)
                    {
                        dpOilLeakage.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["OilleakageId"]).ToString()).Selected = true;
                    }
                }
                catch (InvalidCastException)
                {
                    dpOilLeakage.SelectedIndex = 0;
                }
                txtQtyHomogenized.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["HomogenizedQty"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["HomogenizedQty"].ToString();
                txtTechnician.Text     = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Technician"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Technician"].ToString();
                txtHomogenized.Text    = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Homogenized"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Homogenized"].ToString();
                txtRemarks.Text        = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Remarks"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Remarks"].ToString();
                txtStartingTime.Text   = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MachineStartTime"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MachineStartTime"].ToString();
                txtEndTime.Text        = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MachineEndTime"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MachineEndTime"].ToString();

                dpStatusDetails.ClearSelection();
                string StatusDetails = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["HomogenizerStatusId"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["HomogenizerStatusId"].ToString();

                if (StatusDetails == "")
                {
                    dpStatusDetails.SelectedIndex = 2;
                }
                else
                {
                    dpStatusDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["HomogenizerStatusId"]).ToString()).Selected = true;
                }
                //try
                //{
                //    dpStatusDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["HomogenizerStatusId"]).ToString()).Selected = true;
                //}
                //catch (InvalidCastException)
                //{
                //    dpStatusDetails.SelectedIndex = 2;
                //}
            }
        }