Exemplo n.º 1
0
        private void frmRPDBatchInitialize_Load(object sender, EventArgs e)
        {
            try
            {
                Department objDep      = objDepartmentDL.GetByDepType("RPD");
                Department objStoreDep = objDepartmentDL.GetByDepType("Store");

                cmbActivityInstructions.DataSource = objMainActivityDL.GetByDepID(objDep.DepID);


                txtQtyBasic.Text = objRPDBatch.RPDBatchQty.ToString();
                lblID.Text       = objRPDBatch.RPDBatchID;
                txtMateral.Text  = objRPDBatch.RPDBatchMaterial.MaterialCode + " - " + objRPDBatch.RPDBatchMaterial.MaterialDescription;

                if (objRPDBatch.RPDBatchID != null)
                {
                    dgvActivityInstructions.AutoGenerateColumns = false;
                    bindInstructions.DataSource        = objRPDBatchActivityInstructionsDL.GetDataView(objRPDBatch.RPDBatchID);
                    dgvActivityInstructions.DataSource = bindInstructions;
                    bindInstructions.ResetBindings(true);

                    gvProduction.AutoGenerateColumns = false;
                    bindProduction.DataSource        = objRPDBatchProductionDL.GetDataByBatchID(objRPDBatch.RPDBatchID);
                    gvProduction.DataSource          = bindProduction;
                    bindProduction.ResetBindings(true);
                }

                bindMaterial_Inter.DataSource = objMaterialDL.GetDataViewIntermediates(objRPDBatch.RPDBatchMaterial.MaterialCode);
                cmbMaterialInter.DataSource   = bindMaterial_Inter;
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occcured while loading", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 2
0
        private void cmbMaterialList_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (cmbMaterialList.SelectedValue != null)
                {
                    Material objMat = objMaterialDL.Get(cmbMaterialList.SelectedValue.ToString());
                    if (objMat != null)
                    {
                        lblUnitMat.Text = objMat.MatUnit.UnitCode;
                        bindMaterial_Inter.DataSource = objMaterialDL.GetDataViewIntermediates(objMat.MaterialCode);
                        cmbMaterialInter.DataSource   = bindMaterial_Inter;

                        Load_LP_Stock(objMat);
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(this, "Error occured while loading Material", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 3
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);
            }
        }