public int machinereportdata(MMachineComplaintsAndRectifiedRecord receive)
        {
            damcr = new DAMachineComplaintsAndRectifiedRecord();
            int Result = 0;

            try
            {
                Result = damcr.machinereportdata(receive);
            }
            catch (Exception)
            {
                throw;
            }
            return(Result);
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            {
                mmcr = new MMachineComplaintsAndRectifiedRecord();
                bmcr = new BMachineComplaintsAndRectifiedRecord();
                int Result = 0;
                mmcr.MachineComplaintsAndRectifiedRecordId      = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value);
                mmcr.MachineComplaintsAndRectifiedRecordDate    = Convert.ToDateTime(txtComplaintsDate.Text.ToString());
                mmcr.MachineComplaintsAndRectifiedRecordShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                mmcr.MachineName            = txtMachineName.Text;
                mmcr.IdentifiedBy           = txtIdentifiedBy.Text;
                mmcr.RectifiedBy            = txtRectifiedBy.Text;
                mmcr.RectifiedDate          = Convert.ToDateTime(txtRectifiedDate.Text.ToString());
                mmcr.MachineRectifiedStatus = Convert.ToInt32(dpStatusDetails.SelectedItem.Value);
                mmcr.flag = "Update";
                Result    = bmcr.machinereportdata(mmcr);
                if (Result > 0)
                {
                    divDanger.Visible  = false;
                    divwarning.Visible = false;

                    divSusccess.Visible = true;
                    lblSuccess.Text     = "Machine Complaints And Rectified  Data Update  Successfully";
                    pnlError.Update();
                    // GetPastDetails();
                }
                else
                {
                    divDanger.Visible   = false;
                    divwarning.Visible  = true;
                    divSusccess.Visible = false;
                    lblSuccess.Text     = "Something went wrong plz contact site admin";
                    pnlError.Update();
                }

                //return Result;
            }
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            {
                mmcr = new MMachineComplaintsAndRectifiedRecord();
                bmcr = new BMachineComplaintsAndRectifiedRecord();
                int Result = 0;
                mmcr.MachineComplaintsAndRectifiedRecordId      = 0;
                mmcr.MachineComplaintsAndRectifiedRecordDate    = Convert.ToDateTime(txtComplaintsDate.Text.ToString());
                mmcr.MachineComplaintsAndRectifiedRecordShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value);
                mmcr.MachineName            = txtMachineName.Text;
                mmcr.IdentifiedBy           = txtIdentifiedBy.Text;
                mmcr.RectifiedBy            = txtRectifiedBy.Text;
                mmcr.RectifiedDate          = Convert.ToDateTime(txtRectifiedDate.Text.ToString());
                mmcr.MachineRectifiedStatus = Convert.ToInt32(dpStatusDetails.SelectedItem.Value);
                mmcr.flag = "Insert";
                Result    = bmcr.machinereportdata(mmcr);
                if (Result > 0)
                {
                    divDanger.Visible  = false;
                    divwarning.Visible = false;

                    divSusccess.Visible = true;
                    lblSuccess.Text     = "Machine Complaints And Rectified  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();
                }

                //return Result;
            }
        }
Beispiel #4
0
        //
        public int machinereportdata(MMachineComplaintsAndRectifiedRecord receive)
        {
            int result = 0;

            try
            {
                DBParameterCollection paramcollection = new DBParameterCollection();
                paramcollection.Add(new DBParameter("@MachineComplaintsAndRectifiedRecordId", receive.MachineComplaintsAndRectifiedRecordId));
                paramcollection.Add(new DBParameter("@MachineComplaintsAndRectifiedRecordDate", receive.MachineComplaintsAndRectifiedRecordDate));
                paramcollection.Add(new DBParameter("@MachineComplaintsAndRectifiedRecordShiftId", receive.MachineComplaintsAndRectifiedRecordShiftId));
                paramcollection.Add(new DBParameter("@MachineName", receive.MachineName));
                paramcollection.Add(new DBParameter("@IdentifiedBy", receive.IdentifiedBy));
                paramcollection.Add(new DBParameter("@RectifiedBy", receive.RectifiedBy));
                paramcollection.Add(new DBParameter("@RectifiedDate", receive.RectifiedDate));
                paramcollection.Add(new DBParameter("@MachineRectifiedStatus", receive.MachineRectifiedStatus));
                paramcollection.Add(new DBParameter("@flag", receive.flag));
                result = _DBHelper.ExecuteNonQuery("prod_spMachineComplaintsAndRectifiedDetails", paramcollection, CommandType.StoredProcedure);
            }
            catch (Exception EX)
            {
                String MSG = EX.ToString();
            }
            return(result);
        }