Esempio n. 1
0
        public int Add(RPDBatch obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchID", obj.RPDBatchID),
                    new SqlParameter("@RPDBatchSuperviserID", obj.RPDBatchSupervisedBy),
                    new SqlParameter("@RPDBatchMaterialCode", obj.RPDBatchMaterial),
                    new SqlParameter("@RPDBatchQty", obj.RPDBatchQty),
                    new SqlParameter("@RPDBatchInstructedBy", obj.RPDBatchInstructedBy),
                    new SqlParameter("@RPDBatchInstructedDate", obj.RPDBatchInstructedDate),
                    new SqlParameter("@RPDBatchStartDate", obj.RPDBatchStartDate),
                    new SqlParameter("@RPDBatchEndDate", obj.RPDBatchEndDate),
                    new SqlParameter("@RPDBatchFinalQty", obj.RPDBatchFinalQty),
                    new SqlParameter("@RPDBatchStatus", obj.Status),
                    new SqlParameter("@RPDBatchMRNO", obj.RPDBatchMR),
                    new SqlParameter("@RPDBatchType", obj.Type),
                    new SqlParameter("@RPDBatchApprovedBy", obj.ApprovedBy),
                    new SqlParameter("@RPDBatchApprovedDate", obj.ApprovedDate),
                    new SqlParameter("@RPDBatchEndBy", obj.EndBy)
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPADD_RPDBatch", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 2
0
        private void gvRPDBatch_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0)
                {
                    String ID = gvRPDBatch.CurrentRow.Cells["RPDBatchID"].Value.ToString();

                    objRPDBatch = objRPDBatchDL.Get(ID);

                    if (objRPDBatch != null)
                    {
                        RPD.frmRPDBatchFileView objFrm = new frmRPDBatchFileView(CurrentUser, objRPDBatch);
                        objFrm.ShowDialog(this);
                    }
                    else
                    {
                        //btnEdit.Enabled = false;
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured while loading Batch File", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 3
0
 public frmAddActivity(User objuser, RPDBatch objRpdbatch)
 {
     objRPDBatch = objRpdbatch;
     CurrentUser = objuser;
     objRPDBatchActivity.RPDBatchActID = 0;
     InitializeComponent();
 }
Esempio n. 4
0
 public frmAddActivity(User objuser, RPDBatch objRpdbatch, SESD.MRP.REF.RPDBatchActivity objRPDBatchAct)
 {
     objRPDBatch         = objRpdbatch;
     CurrentUser         = objuser;
     objRPDBatchActivity = objRPDBatchAct;
     InitializeComponent();
     txtComment.Text = objRPDBatchActivity.Comments;
     //cmbInstructedBy.SelectedValue = objRPDBatchActivity.InspectedBy;
     cmbSupervisedBy.SelectedValue = objRPDBatchActivity.SupervisedBy;
 }
Esempio n. 5
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                objRPDBatch.RPDBatchMaterial     = objMaterialDL.Get(cmbMaterialList.SelectedValue.ToString());
                objRPDBatch.RPDBatchQty          = Convert.ToDecimal(txtQtyBasic.Text);
                objRPDBatch.Status               = RPDBatch.RPDBatchStatus.Created;
                objRPDBatch.RPDBatchInstructedBy = CurrentUser.UserEmp;
                objRPDBatch.Type = cmbBatchType.SelectedItem.ToString();
                if (objRPDBatch.RPDBatchQty <= 0)
                {
                    MessageBox.Show(this, "Invalid Quantity", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    String NewID = objRPDBatchDL.Add_Initial(objRPDBatch);

                    if (NewID != null)
                    {
                        lblID.Text              = NewID;
                        objRPDBatch.RPDBatchID  = NewID;
                        txtQtyBasic.ReadOnly    = true;
                        grpInstructions.Enabled = true;
                        grpProduction.Enabled   = true;

                        objRPDBatch = objRPDBatchDL.Get(objRPDBatch.RPDBatchID);


                        //long MRNO = GenerateMR(objRPDBatch);
                        //if (MRNO > 0)
                        //{
                        //    objRPDBatchDL.Update(objRPDBatch.RPDBatchID, MRNO);
                        //    objRPDBatch = objRPDBatchDL.Get(objRPDBatch.RPDBatchID);

                        //}


                        MessageBox.Show(this, "Successfully Created, Now you can add Instructions to the batch file", "Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        Load_BatchList();

                        pnlBatchDetails.Enabled = false;
                        grpInstructions.Enabled = true;
                        grpProduction.Enabled   = true;
                    }
                }

                //this.frmRPDBatchInitialize_Load(sender, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 6
0
        public int Update_Transfer(RPDBatch obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchID", obj.RPDBatchID),
                    new SqlParameter("@RPDBatchStatus", obj.Status)
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_RPDBatch_Transfer", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 7
0
        public int Update_BatchSize(RPDBatch obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchID", obj.RPDBatchID),
                    new SqlParameter("@RPDBatchQty", obj.RPDBatchQty),
                    new SqlParameter("@RPDBatchInstructedBy", obj.RPDBatchInstructedBy.EmployeeID)
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_RPDBatch_BatchQty", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 8
0
        public int Update_Finish(RPDBatch obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchID", obj.RPDBatchID),
                    new SqlParameter("@RPDBatchStatus", obj.Status),
                    new SqlParameter("@RPDBatchEndBy", obj.EndBy.EmployeeID)
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_RPDBatch_Finalize", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 9
0
        private void btnSendMR_Click(object sender, EventArgs e)
        {
            try
            {
                long MRNO = GenerateMR(objRPDBatch);

                if (MRNO >= 0)
                {
                    objRPDBatchDL.Update(objRPDBatch.RPDBatchID, MRNO);
                    objRPDBatch = objRPDBatchDL.Get(objRPDBatch.RPDBatchID);
                    LoadBatch();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Error occured while Sending MR", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 10
0
        public int Approve(RPDBatch obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchID", obj.RPDBatchID),
                    new SqlParameter("@RPDBatchApprovedBy", obj.ApprovedBy.EmployeeID),
                    new SqlParameter("@RPDBatchApprovedDate", obj.ApprovedDate),
                    new SqlParameter("@RPDBatchStatus", obj.Status),
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_RPDBatch_Approve", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 11
0
        public int Update_Start(RPDBatch obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchID", obj.RPDBatchID),
                    new SqlParameter("@RPDBatchSuperviserID", obj.RPDBatchSupervisedBy.EmployeeID),
                    new SqlParameter("@RPDBatchStartDate", obj.RPDBatchStartDate),
                    new SqlParameter("@RPDBatchStatus", (int)obj.Status)
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_RPDBatch_Start", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 12
0
        public long GenerateMR(RPDBatch objRPD)
        {
            MR objMR = new MR();
            MRMaterialCollec      objMRMatCollec           = new MRMaterialCollec();
            MRFinishProductCollec objMRFinishProductCollec = new MRFinishProductCollec();
            MRBasicProductCollec  objMRBasicProductCollec  = new MRBasicProductCollec();
            BatchMR       objBatchMR      = new BatchMR();
            Department_DL objDepDL        = new Department_DL(ConnectionStringClass.GetConnection());
            MR_DL         objMRDL         = new MR_DL(ConnectionStringClass.GetConnection());
            MRMaterial_DL objMRMaterialDL = new MRMaterial_DL(ConnectionStringClass.GetConnection());
            Store_DL      objStoreDL      = new Store_DL(ConnectionStringClass.GetConnection());

            try
            {
                objMR.MRDate           = DateTime.Now;
                objMR.MRDepartmentFrom = objDepDL.GetByDepType("RPD");
                objMR.MREnterdBy       = CurrentUser.EmployeeID;
                objMR.MRStatus         = MR.Status.Initial;
                Store objStore = objStoreDL.Get("RM_Processed");
                objMR.MRStore    = objStoreDL.Get(objStore.StoreID);
                objMR.MRType     = MR.Type.Material;
                objMR.MRRemarks  = "Material Requition(Materials) for RPD Batch NO " + objRPD.RPDBatchID;
                objMR.OriginType = MR.Origin.ToBatch;

                MRMaterial obj = new MRMaterial();
                obj.Description = "RPD Batch Material Requition";
                obj.Material    = objRPD.RPDBatchMaterial;
                obj.MRBINNo     = "";
                obj.ReqdQty     = objRPD.RPDBatchQty;

                long MRNO = objMRDL.Add_M(objMR);
                if (MRNO > 0)
                {
                    objMR.MRNO = MRNO;
                    obj.MR     = objMR;
                    objMRMaterialDL.Add(obj);
                }
                return(MRNO);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }
Esempio n. 13
0
        public RPDBatchCollec GetByState(int RPDBatchState)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchStatus", RPDBatchState)
                };


                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_RPDBatchByState", paramList);

                RPDBatchCollec objCollec = new RPDBatchCollec();
                RPDBatch       obj       = new RPDBatch();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        obj.RPDBatchID             = Convert.ToString(dt.Rows[i]["RPDBatchID"]);
                        obj.RPDBatchSupervisedBy   = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchSuperviserID"]));
                        obj.RPDBatchMaterial       = objMaterial_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchMaterialCode"]));
                        obj.RPDBatchQty            = Convert.ToDecimal(dt.Rows[i]["RPDBatchQuantity"]);
                        obj.RPDBatchInstructedBy   = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["RPDBatchInstructedBy"]));
                        obj.RPDBatchInstructedDate = Convert.ToDateTime(dt.Rows[i]["RPDBatchInstructedDate"]);
                        obj.RPDBatchStartDate      = Convert.ToDateTime(dt.Rows[i]["RPDBatchStartDate"]);
                        obj.RPDBatchEndDate        = Convert.ToDateTime(dt.Rows[i]["RPDBatchEndDate"]);
                        obj.RPDBatchFinalQty       = Convert.ToDecimal(dt.Rows[i]["RPDBatchFinalQty"]);
                        obj.Status     = (RPDBatch.RPDBatchStatus)Enum.Parse(typeof(RPDBatch.RPDBatchStatus), Convert.ToString(dt.Rows[i]["RPDBatchStatus"]));
                        obj.RPDBatchMR = objMR_DL.Get(Convert.ToInt64(dt.Rows[i]["RPDBatchMRNO"]));
                        obj.Status     = (RPDBatch.RPDBatchStatus)Enum.Parse(typeof(RPDBatch.RPDBatchStatus), Convert.ToString(dt.Rows[i]["MaterialName"]));

                        objCollec.Add(obj);
                    }
                }

                return(objCollec);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 14
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (objRPDBatch != null)
                {
                    DialogResult dr = MessageBox.Show(this, "Are you sure you want to delete Selected RPD batch?\n\nClick Yes to delete", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (dr == DialogResult.Yes)
                    {
                        MR_DL objMRDL = new MR_DL(ConnectionStringClass.GetConnection());
                        if (objRPDBatch.RPDBatchMR.MRStatus == MR.Status.Initial || objRPDBatch.RPDBatchMR.MRStatus == MR.Status.Reject)
                        {
                            if (objRPDBatch.RPDBatchMR.MRStatus == MR.Status.Initial)
                            {
                                objMRDL.Delete(objRPDBatch.RPDBatchMR.MRNO);
                            }

                            int res = objRPDBatchDL.Delete(objRPDBatch.RPDBatchID);

                            if (res > 0)
                            {
                                bindRPDBatch.DataSource = objRPDBatchDL.GetDataViewByState(Status, true);
                                ClearForm();
                                objRPDBatch = null;
                            }
                        }
                        else
                        {
                            MessageBox.Show(this, "Material Requsition In Prograss, You can't delete this RPD Batch File\nReject the Material Requsition and Try again.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please select the RPD Batch file you want to delete", "Empty Selection", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured while deleting", "Error", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
Esempio n. 15
0
        private void gvRPDBatch_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                try
                {
                    objRPDBatch = objRPDBatch_DL.Get(gvRPDBatch.CurrentRow.Cells["RPDBatchID"].Value.ToString());
                    if (objRPDBatch != null)
                    {
                        frmRptRPDBatchCost objFrm = new frmRptRPDBatchCost(CurrentUser, objRPDBatch.RPDBatchID);
                        objFrm.ShowDialog(this);

                        Load_List();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show(this, "Error occured while loading Batch details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Esempio n. 16
0
        public RPDBatch Get(String RPDBatchID)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchID", RPDBatchID)
                };


                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_RPDBatch_By_ID", paramList);

                RPDBatch obj = new RPDBatch();

                if (dt.Rows.Count > 0)
                {
                    obj.RPDBatchID             = Convert.ToString(dt.Rows[0]["RPDBatchID"]);
                    obj.RPDBatchSupervisedBy   = objEmployee_DL.Get(Convert.ToString(dt.Rows[0]["RPDBatchSuperviserID"]));
                    obj.RPDBatchMaterial       = objMaterial_DL.Get(Convert.ToString(dt.Rows[0]["RPDBatchMaterialCode"]));
                    obj.RPDBatchQty            = Convert.ToDecimal(dt.Rows[0]["RPDBatchQty"]);
                    obj.RPDBatchInstructedBy   = objEmployee_DL.Get(Convert.ToString(dt.Rows[0]["RPDBatchInstructedBy"]));
                    obj.RPDBatchInstructedDate = Convert.ToDateTime(dt.Rows[0]["RPDBatchInstructedDate"]);
                    obj.RPDBatchStartDate      = Convert.ToDateTime(dt.Rows[0]["RPDBatchStartDate"]);
                    obj.RPDBatchEndDate        = Convert.ToDateTime(dt.Rows[0]["RPDBatchEndDate"]);
                    obj.RPDBatchFinalQty       = Convert.ToDecimal(dt.Rows[0]["RPDBatchFinalQty"]);
                    obj.Status       = (RPDBatch.RPDBatchStatus)Enum.Parse(typeof(RPDBatch.RPDBatchStatus), Convert.ToString(dt.Rows[0]["RPDBatchStatus"]));
                    obj.RPDBatchMR   = objMR_DL.Get(Convert.ToInt64(dt.Rows[0]["RPDBatchMRNO"]));
                    obj.Type         = Convert.ToString(dt.Rows[0]["RPDBatchType"]);
                    obj.ApprovedBy   = objEmployee_DL.Get(Convert.ToString(dt.Rows[0]["RPDBatchApprovedBy"]));
                    obj.ApprovedDate = Convert.ToDateTime(dt.Rows[0]["RPDBatchApprovedDate"]);
                    obj.EndBy        = objEmployee_DL.Get(Convert.ToString(dt.Rows[0]["RPDBatchEndBy"]));
                }

                return(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 17
0
        private void gvRPDBatch_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                try
                {
                    String ID = gvRPDBatch.Rows[e.RowIndex].Cells["RPDBatchID"].Value.ToString();

                    objRPDBatch = objRPDBatchDL.Get(ID);

                    if (objRPDBatch != null)
                    {
                        LoadBatch();

                        if (objRPDBatch.Status == RPDBatch.RPDBatchStatus.Started)
                        {
                            bool x = objQCReport_DL.IsRPDBatchAccept(gvRPDBatch.CurrentRow.Cells["RPDBatchID"].Value.ToString(), (int)QCReport.ReportStatus.Accept);
                            if (x == false)
                            {
                                btnEdit.Enabled = true;
                            }
                            else
                            {
                                btnEdit.Enabled = false;
                            }
                        }
                    }
                    else
                    {
                        btnEdit.Enabled = false;
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show(this, "Error occured while Loading the RPD Batch", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Esempio n. 18
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                if ((objRPDBatch.RPDBatchMR.MRNO == 0) | (objRPDBatch.RPDBatchMR.MRStatus == MR.Status.Initial) | (objRPDBatch.RPDBatchMR.MRStatus == MR.Status.Reject))
                {
                    objRPDBatch.RPDBatchQty          = Convert.ToDecimal(txtQtyBasic.Text);
                    objRPDBatch.RPDBatchInstructedBy = CurrentUser.UserEmp;
                    if (objRPDBatch.RPDBatchQty <= 0)
                    {
                        MessageBox.Show(this, "Invalid Quantity", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        int x = objRPDBatchDL.Update_BatchSize(objRPDBatch);

                        if (x > 0)
                        {
                            txtQtyBasic.ReadOnly    = true;
                            grpInstructions.Enabled = true;
                            grpProduction.Enabled   = true;

                            objRPDBatch = objRPDBatchDL.Get(objRPDBatch.RPDBatchID);

                            MessageBox.Show(this, "Successfully Edited", "Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);

                            pnlBatchDetails.Enabled = false;
                            grpInstructions.Enabled = true;
                            grpProduction.Enabled   = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 19
0
        private void btnApprove_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult theResult = new DialogResult();

                theResult = MessageBox.Show(this, "Do You want to Approve the Costing Report?", "Confirmation", MessageBoxButtons.YesNo);

                if (theResult == System.Windows.Forms.DialogResult.Yes)
                {
                    if (gvRPDBatch.CurrentRow.Cells["RPDBatchID"].Value != null)
                    {
                        txtDryerRate.Text = gvRPDBatch.CurrentRow.Cells["DryerRate"].Value.ToString();

                        Employee_DL objEmployee_DL = new Employee_DL(ConnectionStringClass.GetConnection());

                        objRPDBatch = objRPDBatch_DL.Get(gvRPDBatch.CurrentRow.Cells["RPDBatchID"].Value.ToString());

                        objRPDBatch.Status = RPDBatch.RPDBatchStatus.Finished;

                        objRPDBatch_DL.Update_Cost(objRPDBatch.RPDBatchID, CurrentUser.EmployeeID);

                        int x = objRPDBatch_DL.Update_ApproveCost(objRPDBatch);

                        if (x > 0)
                        {
                            MessageBox.Show(this, "Successfully Approved", "Successful", MessageBoxButtons.OK);
                        }
                        Load_List();
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured while loading Batch details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 20
0
        public String Add_Initial(RPDBatch obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@RPDBatchMaterialCode", obj.RPDBatchMaterial.MaterialCode),
                    new SqlParameter("@RPDBatchQty", obj.RPDBatchQty),
                    new SqlParameter("@RPDBatchInstructedBy", obj.RPDBatchInstructedBy.EmployeeID),
                    new SqlParameter("@RPDBatchStatus", (int)obj.Status),
                    new SqlParameter("@RPDBatchType", obj.Type),
                    new SqlParameter("@outParam", SqlDbType.VarChar, 50)
                    {
                        Direction = ParameterDirection.Output
                    }
                };


                return(Execute.RunSP_Output_String(Connection, "SPADD_RPDBatch_Initial", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 21
0
        private void frmQC_Load(object sender, EventArgs e)
        {
            try
            {
                if (objQCReport != null)
                {
                    cmbTestBy.DataSource      = objEmployee_DL.Get_By_DepType("LAB", true);
                    cmbRDQAOfficer.DataSource = objEmployee_DL.Get_By_DepType("LAB", true);
                    cmbAnalizedBy.DataSource  = objEmployee_DL.Get_By_DepType("LAB", true);
                    cmbParameter.DataSource   = objTestParameter_DL.GetView(objQCReport.ReportType);
                    bindDetails.DataSource    = objQCReportDetails_DL.GetView(objQCReport.QCReportID);

                    if (objQCReport.ReportType.Equals("RPD"))
                    {
                        txtBatch.Text          = objQCReport.RPDBatchID;
                        objRPDBatch            = objRPDBatch_DL.Get(objQCReport.RPDBatchID);
                        cmbMaterial.DataSource = objMaterial_DL.GetDataViewIntermediates(objRPDBatch.RPDBatchMaterial.MaterialCode);
                        //cmbMaterial.DataSource = objMaterial_DL.Get_RPD_DataView(objQCReport.RPDBatchID);
                        txtBatch.Text = objRPDBatch.RPDBatchID;
                    }
                    else if (objQCReport.ReportType.Equals("PRPD"))
                    {
                        txtBatch.Text          = objQCReport.RPDBatchID;
                        objPRPDBatch           = objPRPDBatch_DL.Get(objQCReport.PRPDBatchID);
                        cmbMaterial.DataSource = objMaterial_DL.GetDataViewIntermediates(objPRPDBatch.PRPDBatchMaterial.MaterialCode);
                        txtBatch.Text          = objPRPDBatch.PRPDBatchID;
                    }

                    else if (objQCReport.ReportType.Equals("PRODUCTION"))
                    {
                        txtBatch.Text = objQCReport.ProductionBatchID;
                        objBatch      = objBatch_DL.Get(objQCReport.ProductionBatchID);
                        //cmbMaterial.DataSource = objMaterial_DL.GetDataViewIntermediates("", "", objPRPDBatch.PRPDBatchMaterial.MaterialCode);
                        lblItem.Text = "Product";
                        BasicProductCollec objCollec = new BasicProductCollec();
                        objCollec.Add(objBatch.StandardBatch.STDBatchBasicProduct);


                        cmbMaterial.DataSource    = objCollec;
                        cmbMaterial.DisplayMember = "Code";
                        cmbMaterial.ValueMember   = "BasicProductCode";
                    }
                    txtReportID.Text   = objQCReport.QCReportID.ToString();
                    txtReportType.Text = objQCReport.ReportType;
                    txtSampleSize.Text = objQCReport.SampleSize;
                    txtSendBy.Text     = objEmployee_DL.Get(objQCReport.SendBy).EmployeeNameID;
                    txtSendDate.Text   = objQCReport.SendDate.Value.ToShortDateString();
                    if (objQCReport.RDQAOfficer != null)
                    {
                        cmbRDQAOfficer.SelectedValue = objQCReport.RDQAOfficer;
                    }

                    if (objQCReport.AnalyzedBy != null)
                    {
                        cmbAnalizedBy.SelectedValue = objQCReport.AnalyzedBy;
                    }

                    if (objQCReport.TestBy != null)
                    {
                        cmbTestBy.SelectedValue = objQCReport.TestBy;
                    }
                    txtRemarks.Text = objQCReport.Remarks;

                    if (objQCReport.Status != Convert.ToInt32(QCReport.ReportStatus.Initial))
                    {
                        grpDetails.Enabled = false;
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured while loading", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 22
0
        private void btnManage_Click(object sender, EventArgs e)
        {
            if (Status == RPDBatch.RPDBatchStatus.Created)
            {
                if (objRPDBatch != null)
                {
                    DialogResult dr = MessageBox.Show(this, "Are you sure you want to approve selected RPD Batch?\nThis will raise a Material Requsition and send to the selected Store\n\nClick Yes to continue", "Confirm Approve", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        {
                            long MRNO = GenerateMR(objRPDBatch);

                            if (MRNO >= 0)
                            {
                                objRPDBatchDL.Update(objRPDBatch.RPDBatchID, MRNO);
                                objRPDBatch.Status     = RPDBatch.RPDBatchStatus.Approved;
                                objRPDBatch.ApprovedBy = CurrentUser.UserEmp;

                                int res = objRPDBatchDL.Approve(objRPDBatch);
                                if (res > 0)
                                {
                                    Load_Batch_List();
                                    ClearForm();
                                    objRPDBatch = null;
                                }
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please select a RPD Batch File you want to approve", "Empty Selection", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else if (Status == RPDBatch.RPDBatchStatus.Approved)
            {
                if (objRPDBatch != null)
                {
                    if (objRPDBatch.RPDBatchMR.MRStatus != MR.Status.Reject)
                    {
                        MessageBox.Show(this, "You should reject the MR before Discarding RPD batch", "Action Denied", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    }
                    else
                    {
                        DialogResult dr = MessageBox.Show(this, "Are you sure you want to Discard selected RPD Batch File?\n\nClick Yes to Discard", "Confirm Discard", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

                        if (dr == DialogResult.Yes)
                        {
                            objRPDBatch.Status = RPDBatch.RPDBatchStatus.Discarded;
                            int res = objRPDBatchDL.Update(objRPDBatch);
                            if (res > 0)
                            {
                                bindRPDBatch.DataSource = objRPDBatchDL.GetDataViewByState(Status, true);
                                ClearForm();
                                objRPDBatch = null;
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please select the RPD batch you want to Discard", "Empty Selection", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Esempio n. 23
0
 public frmRPDBatchInitialize(User objUser, RPDBatch obj)
 {
     InitializeComponent();
     CurrentUser = objUser;
     objRPDBatch = obj;
 }
Esempio n. 24
0
 public frmRPDBatchFileView(User objUser, RPDBatch objRPDBatch)
 {
     this.objRPDBatch = objRPDBatch;
     CurrentUser      = objUser;
     InitializeComponent();
 }