示例#1
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);
            }
        }
示例#2
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);
            }
        }
示例#3
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);
                }
            }
        }
示例#4
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);
            }
        }
示例#5
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);
            }
        }
示例#6
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);
            }
        }