Exemplo n.º 1
0
        public void Load_Data(SqlConnection Conn, string MatCode)
        {
            objMaterial_DL    = new Material_DL(Conn);
            objStore_DL       = new Store_DL(Conn);
            objDepartment_DL  = new Department_DL(Conn);
            BasicMaterialCode = MatCode;

            objMaterial = objMaterial_DL.GetProcessdMaterial(BasicMaterialCode);

            if (objMaterial != null)
            {
                textBox1.Text = objMaterial.MaterialNameCode;
                //cmbStoreTo.DataSource = objStore_DL.GetData();
                //cmbStoreTo.SelectedValue = objStore_DL.Get_Default(objDepartment_DL.GetByDepType("Store").DepID).StoreID;
                //cmbStoreTo.Enabled = true;
            }
            else
            {
                //cmbStoreTo.Enabled = false;
                textBox1.Text = "N/A";
            }
        }
Exemplo n.º 2
0
        private void cmbPRPDBatch_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbPRPDBatch.SelectedValue != null)
            {
                try
                {
                    objPRPDBatch = objPRPDBatch_DL.Get(cmbPRPDBatch.SelectedValue.ToString());


                    dtPRPDBatchActivity = objPRPDBatchActivityInstructions_DL.GetDataByBatchID(cmbPRPDBatch.SelectedValue.ToString());

                    dgvActivities.AutoGenerateColumns     = false;
                    dgvActivities.DataSource              = objSourcePRPDBatchActivity;
                    objSourcePRPDBatchActivity.DataSource = dtPRPDBatchActivity;
                    objSourcePRPDBatchActivity.ResetBindings(true);
                    txtAddedUnitCost.Text = objPRPDBatch_DL.UnitPrice(objPRPDBatch.PRPDBatchID).ToString();


                    txtBatchState.Text = Enum.GetName(typeof(PRPDBatch.PRPDBatchStatus), objPRPDBatch.Status);

                    txtMRNo.Text         = objPRPDBatch.MRIN.ToString();
                    txtUnitPrice.Text    = objMRMaterial_DL.Get(objPRPDBatch.MRIN, objPRPDBatch.PRPDBatchMaterial.MaterialCode).UniRate.ToString();
                    txtMaterialCode.Text = objPRPDBatch.PRPDBatchMaterial.MaterialCode;
                    txtMaterialName.Text = objPRPDBatch.PRPDBatchMaterial.MaterialNameCode;

                    txtStartDate.Text = objPRPDBatch.PRPDBatchInstructedDate.ToShortDateString();

                    txtStopDate.Text       = objPRPDBatch.PRPDBatchEndDate.ToShortDateString();
                    txtPRPDBatchQty.Text   = objPRPDBatch.PRPDBatchFinalQty.ToString();
                    txtInstructedBy.Text   = objPRPDBatch.PRPDBatchInstructedBy.EmployeeName;
                    txtAfterReworkQty.Text = objPRPDBatch.PRPDBatchFinalQty.ToString();
                    txtDescription.Text    = objPRPDBatch.PRPDBatchComments;
                    lblUnit.Text           = objPRPDBatch.PRPDBatchMaterial.MatUnit.UnitCode;
                    lblUnit1.Text          = objPRPDBatch.PRPDBatchMaterial.MatUnit.UnitCode;


                    if (objPRPDBatch.Type == PRPDBatch.PRPDType.Rework)
                    {
                        objProcessed     = objMaterial_DL.GetDryMaterial(objPRPDBatch.PRPDBatchMaterial.MaterialCode);
                        txtMaterial.Text = objProcessed.MaterialCode + " - " + objProcessed.MaterialDescription;
                    }
                    else
                    {
                        objProcessed     = objMaterial_DL.GetProcessdMaterial(objPRPDBatch.PRPDBatchMaterial.MaterialCode);
                        txtMaterial.Text = objProcessed.MaterialCode + " - " + objProcessed.MaterialDescription;
                    }

                    if (objProcessed.MaterialCode == null)
                    {
                        btnTransfer.Enabled = false;
                    }
                    else
                    {
                        btnTransfer.Enabled = true;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
            }
        }