示例#1
0
        private void LoadMaterialList()
        {
            try
            {
                if ((cmbBatchNo.SelectedValue != null) && (cmbPart.Text != ""))
                {
                    objBatch = objBatch_DL.Get(cmbBatchNo.SelectedValue.ToString());

                    dt = objBatchFormulaMaterial_DL.GetView(objBatch.BatchID, cmbPart.Text);

                    dgvItemList.AutoGenerateColumns  = false;
                    objSourceMaterialList.DataSource = dt;
                    dgvItemList.DataSource           = objSourceMaterialList;
                    objSourceMaterialList.ResetBindings(true);


                    DepID = objDepDL.Get(objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, "Manf");
                    DataTable dtMR = new DataTable();


                    if (rdbMaterial.Checked == true)
                    {
                        dtMR = objMRDL.GetActiveMR(cmbBatchNo.SelectedValue.ToString(), cmbPart.Text, (int)BatchMR.Status.Rejected, (int)MR.Type.Material, objStore.StoreID);
                    }

                    if (rdbSemiFinished.Checked == true)
                    {
                        dtMR = objMRDL.GetActiveMR(cmbBatchNo.SelectedValue.ToString(), cmbPart.Text, (int)BatchMR.Status.Rejected, (int)MR.Type.BasicProduct, objStore.StoreID);
                    }

                    if (dtMR.Rows.Count > 0)
                    {
                        lblMessage.Text   = "There is a request already made from MRNO : " + dtMR.Rows[0]["MRNO"].ToString() + ".  Please check the status of that requisition";
                        btnSendMR.Enabled = false;
                    }
                    else
                    {
                        lblMessage.Text   = "This will request material list of the selected Part at once";
                        btnSendMR.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        private void LoadSemiFinishedList()
        {
            try
            {
                if (cmbBatchNo.SelectedValue != null)
                {
                    DepID = objBasicProductDL.Get_Department(objBatch_DL.Get(cmbBatchNo.SelectedValue.ToString()).StandardBatch.STDBatchBasicProduct.BasicProductCode, "Manf");

                    if (cmbPart.Text != "")
                    {
                        if (objBatch_DL.GetSemiFinishedRequisitionStatus_ByPart(cmbBatchNo.SelectedValue.ToString(), cmbPart.Text) == 0)
                        {
                            btnAdd.Enabled    = false;
                            btnSendMR.Enabled = false;
                            btnRemove.Enabled = false;
                        }
                        else
                        {
                            btnAdd.Enabled    = true;
                            btnSendMR.Enabled = true;
                            btnRemove.Enabled = true;
                        }
                    }
                }


                BatchFormulaBasicProducts_DL objBatchFormulaBasicProducts_DL = new BatchFormulaBasicProducts_DL(ConnectionStringClass.GetConnection());

                if ((cmbBatchNo.SelectedValue != null) && (cmbPart.Text != ""))
                {
                    DataTable dt = objBatchFormulaBasicProducts_DL.GetView(cmbBatchNo.SelectedValue.ToString(), cmbPart.Text);

                    dgvItemList.AutoGenerateColumns  = false;
                    objSourceMaterialList.DataSource = dt;
                    dgvItemList.DataSource           = objSourceMaterialList;
                    objSourceMaterialList.ResetBindings(true);


                    DataTable dtMR = objMRDL.GetActiveMR(cmbBatchNo.SelectedValue.ToString(), cmbPart.Text, (int)BatchMR.Status.Rejected, (int)MR.Type.BasicProduct, objStore.StoreID);

                    DataTable dtRequested = objMRBasicProductDL.Get_RequestedSemiFinished(cmbBatchNo.SelectedValue.ToString(), cmbPart.Text);

                    dgvItemRequested.AutoGenerateColumns = false;
                    objsourceRequested.DataSource        = dtRequested;
                    dgvItemRequested.DataSource          = objsourceRequested;
                    objsourceRequested.ResetBindings(true);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }