public int machinedata(MMachineStartingCondition receive)
        {
            int result = 0;

            try
            { DBParameterCollection paramcollection = new DBParameterCollection();
              paramcollection.Add(new DBParameter("MachineStartingConditionId", receive.MachineStartingConditionId));
              paramcollection.Add(new DBParameter("MachineStartingConditiondDate", receive.MachineStartingConditiondDate));
              paramcollection.Add(new DBParameter("@MachineStartingConditionShiftId", receive.MachineStartingConditionShiftId));
              paramcollection.Add(new DBParameter("@MachineName", receive.MachineName));
              paramcollection.Add(new DBParameter("@Pasteurizer1", receive.Pasteurizer1));
              paramcollection.Add(new DBParameter("@Pasteurizer2", receive.Pasteurizer2));
              paramcollection.Add(new DBParameter("@Homogenizer1", receive.Homogenizer1));
              paramcollection.Add(new DBParameter("@Homogenizer2", receive.Homogenizer2));
              paramcollection.Add(new DBParameter("@SeparatorPump", receive.SeparatorPump));
              paramcollection.Add(new DBParameter("@BDTill", receive.BDTill));
              paramcollection.Add(new DBParameter("@Report", receive.Report));
              paramcollection.Add(new DBParameter("@Service", receive.Service));
              paramcollection.Add(new DBParameter("@Pending", receive.Pending));
              paramcollection.Add(new DBParameter("@MachineConditionStatus", receive.MachineConditionStatus));
              paramcollection.Add(new DBParameter("@flag", receive.flag));
              result = _DBHelper.ExecuteNonQuery("Prod_spMachineStartingConditionDetails", paramcollection, CommandType.StoredProcedure); }
            catch (Exception EX)
            {
                String MSG = EX.ToString();
            }
            return(result);
        }
Example #2
0
        public int machinedata(MMachineStartingCondition receive)
        {
            damachine = new DAMachineStartingCondition();
            int Result = 0;

            try
            {
                Result = damachine.machinedata(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            mmachine = new MMachineStartingCondition();
            bmachine = new BMachineStartingCondition();
            int Result = 0;

            mmachine.MachineStartingConditionId      = 0;
            mmachine.MachineStartingConditiondDate   = Convert.ToDateTime(txtDate.Text.ToString());
            mmachine.MachineStartingConditionShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
            mmachine.MachineName            = txtMachineName.Text;
            mmachine.Pasteurizer1           = string.IsNullOrEmpty(txtPasteurizer1.Text) ? 0 : Convert.ToInt32(txtPasteurizer1.Text);
            mmachine.Pasteurizer2           = string.IsNullOrEmpty(txtPasteurizer2.Text) ? 0 : Convert.ToInt32(txtPasteurizer2.Text);
            mmachine.Homogenizer1           = string.IsNullOrEmpty(txtHomogenizer1.Text) ? 0 : Convert.ToInt32(txtHomogenizer1.Text);
            mmachine.Homogenizer2           = string.IsNullOrEmpty(txtHomogenizer2.Text) ? 0 : Convert.ToInt32(txtHomogenizer2.Text);
            mmachine.SeparatorPump          = txtSeparatorPump.Text;
            mmachine.BDTill                 = txtBDTill.Text;
            mmachine.Service                = txtService.Text;
            mmachine.Pending                = txtPending.Text;
            mmachine.Report                 = txtReport.Text;
            mmachine.MachineConditionStatus = Convert.ToInt32(dpStatusDetails.SelectedItem.Value);
            mmachine.flag = "Insert";
            Result        = bmachine.machinedata(mmachine);
            if (Result > 0)
            {
                divDanger.Visible  = false;
                divwarning.Visible = false;

                divSusccess.Visible = true;
                lblSuccess.Text     = "Machine Starting Condition Data Add  Successfully";
                pnlError.Update();
                ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').removeClass('collapsed-box');", true);
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblSuccess.Text     = "Something went wrong plz contact site admin";
                pnlError.Update();
            }
        }