public void LoadStore() { try { cmbDepartment.DataSource = objDepDL.Get(); cmbStoreKeeper.DataSource = objEmpDL.Get(); bindStoreList.DataSource = objStoreDL.Get(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMTNReceiveGRN_Load(object sender, EventArgs e) { try { objStore = objStoreDL.Get(StoreID); bindMTNList.DataSource = objMTNDL.Get_From_PRPD_Batches(Convert.ToInt64(MTN.Type.PRPD), Convert.ToInt32(MTN.Status.Cost)); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMRT_Load(object sender, EventArgs e) { try { Material objMat = new Material(); DataTable dt = new DataTable(); bindItemList.DataSource = null; objMRMaterialCollec.Clear(); DataTable dtBatchList = objBatch_DL.Get_BatchList_ToSendMR((int)Batch.Status.In_Progress, (int)Batch.Status.In_Progress, (int)Batch.Status.QCFail, (int)Batch.Status.QCFail, CurrentUser.UserID); objSourceBatchist.DataSource = dtBatchList; cmbBatchNo.DataSource = objSourceBatchist; objStore = objStoreDL.Get("RPD_Main"); txtStore.Text = objStore.StoreName; Load_Materials(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMRT_Load(object sender, EventArgs e) { try { Material objMat = new Material(); DataTable dt = new DataTable(); objDepartment = objDepDL.GetByDepType("RPD"); bindItemList.DataSource = null; objMRMaterialCollec.Clear(); cmbStore.DataSource = objStoreDL.Get(); cmbBatchID.DataSource = objRPDBatch_DL.GetDataViewByState(RPDBatch.RPDBatchStatus.Approved, RPDBatch.RPDBatchStatus.Started, true); dt = objMaterialDL.GetDataView(MaterialCat); objSourceMaterial.DataSource = dt; cmbItem.DataSource = objSourceMaterial; objMat = objMaterialDL.Get(cmbItem.SelectedValue.ToString()); if (objMat != null) { lblUnit.Text = objMat.MatUnit.UnitCode; } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMRT_Load(object sender, EventArgs e) { try { Material objMat = new Material(); DataTable dt = new DataTable(); bindItemList.DataSource = null; objMRMaterialCollec.Clear(); objStore = objStoreDL.Get("Packing"); txtStore.Text = objStore.StoreName; dt = objMaterialDL.GetDataView("Packing"); objSourceMaterial.DataSource = dt; cmbItem.DataSource = objSourceMaterial; objMat = objMaterialDL.Get(cmbItem.SelectedValue.ToString()); if (objMat != null) { lblUnit.Text = objMat.MatUnit.UnitCode; } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMRT_Load(object sender, EventArgs e) { try { BasicProduct objBasic = new BasicProduct(); DataTable dt = new DataTable(); bindItemList.DataSource = null; objMRBasicProductCollec.Clear(); cmbDepartment.DataSource = objUserDepartments_DL.Get(CurrentUser.UserID); objStore = objStoreDL.Get(StoreID); txtStore.Text = objStore.StoreName; dt = objBasicProduct_DL.GetDataView(); objSourceMaterial.DataSource = dt; cmbItem.DataSource = objSourceMaterial; objBasic = objBasicProduct_DL.Get(cmbItem.SelectedValue.ToString()); if (objBasic != null) { lblUnit.Text = objBasic.BasicProductUnit.UnitCode; } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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); } }
private void cmbDepartmentFrom_SelectedIndexChanged(object sender, EventArgs e) { try { cmbStoreFrom.DataSource = objStoreDL.Get(Convert.ToInt64(cmbDepartmentFrom.SelectedValue)); cmbStoreFrom.DisplayMember = "StoreName"; } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmStockManagment_Load(object sender, EventArgs e) { try { //cmbStockType.SelectedIndex = -1; cmbStores.DataSource = objStoreDL.Get(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMTNReceiveGRN_Load(object sender, EventArgs e) { try { objStore = objStoreDL.Get("Finished_Goods_Ayurveda"); bindMTNList.DataSource = objMTNDL.Get_From_AP_Batches_Rework(Convert.ToInt64(MTN.Type.Packing), Convert.ToInt32(MTN.Status.Cost)); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cmbDepartmentFrom_SelectedIndexChanged(object sender, EventArgs e) { try { Department objDep = (Department)cmbDepartmentFrom.SelectedItem; cmbStoreFrom.DataSource = objStoreDL.Get(objDep.DepID); cmbStoreFrom.DisplayMember = "StoreName"; } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMTNReceiveGRN_Load(object sender, EventArgs e) { try { objStore = objStoreDL.Get("RPD_Main"); bindMTNList.DataSource = objMTNDL.Get_Basic_Transfers(Convert.ToInt64(MTN.Type.Batch), Convert.ToInt32(MTN.Status.Cost), Convert.ToInt32(MTN.ItemType.Basic_Product)); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMRT_Load(object sender, EventArgs e) { try { cmbDepartment.DataSource = objDepDL.GetDataView(CurrentUser.EmployeeID); cmbStore.DataSource = objStoreDL.Get(); cmbMRType.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmRPDBatchManage_Load(object sender, EventArgs e) { try { Department objStoreDep = objDepartmentDL.GetByDepType("Store"); cmbStores.DataSource = objStoreDL.Get(objStoreDep.DepID); cmbStores.SelectedValue = "RM_Processed"; cmbStatus.DataSource = Enum.GetValues(typeof(RPDBatch.RPDBatchStatus)); } catch (Exception) { MessageBox.Show(this, "Error occured while loading", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void frmMRT_Load(object sender, EventArgs e) { try { Material objMat = new Material(); DataTable dt = new DataTable(); bindItemList.DataSource = null; objMRFinishProductCollec.Clear(); DataTable dtBatchList = objBatch_DL.Get_BatchList_ToSendMR_Rework((int)Batch.Status.In_Progress, (int)Batch.Status.In_Progress, (int)Batch.Status.QCFail, (int)Batch.Status.QCFail, (int)Batch.Status.Rework, CurrentUser.UserID); objSourceBatchist.DataSource = dtBatchList; cmbBatchNo.DataSource = objSourceBatchist; if (ProductCategory == "AP") { objStore = objStoreDL.Get("Finished_Goods_Ayurveda"); } else if (ProductCategory == "HP") { objStore = objStoreDL.Get("Finished_Goods_Consumer"); } else { } txtStore.Text = objStore.StoreName; Load_FG(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Load_Stores() { try { StoreCollec objStoresCollec = new StoreCollec(); objStoresCollec = objStoreDL.Get(Convert.ToInt64(cmbDepartment.SelectedValue)); objSourceStore.DataSource = objStoresCollec; cmbStore.DataSource = objSourceStore; } catch (Exception ex) { MessageBox.Show(this, "Error occured while Receiving", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmMRT_Load(object sender, EventArgs e) { try { objStore = objStoreDL.Get("RPD_Main"); DataTable dt = objBatch_DL.Get_BatchList_ToSendMR((int)Batch.Status.In_Progress, (int)Batch.Status.In_Progress, (int)Batch.Status.QCFail, (int)Batch.Status.QCFail, CurrentUser.UserID); objSourceBatchist.DataSource = dt; cmbBatchNo.DataSource = objSourceBatchist; } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmGRNMATDirect_Load(object sender, EventArgs e) { try { LoadDirect(); objStore = objStoreDL.Get(StoreID); objDepartment = objDepartmentDL.Get(objStore.StoreDepartment.DepID); txtDepartment.Text = objDepartment.DepName; txtStores.Text = objStore.StoreDescription; } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmPRPDCAPBatchManagement_Load(object sender, EventArgs e) { try { cmbPRPDBatchStatus.DataSource = Enum.GetNames(typeof(PRPDBatch.PRPDBatchStatus)); cmbStores.DataSource = objStore_DL.Get(objDepartment_DL.GetByDepType("Store").DepID); dtStaff = objEmployee_DL.Get_By_RoleType("Manager", "Staff", "Production", true); objSourceStaff.DataSource = dtStaff; //cmbSupervisedBy.DataSource = objSourceStaff; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void frmBinCard_Load(object sender, EventArgs e) { try { objStore = objStore_DL.Get(TheStore); txtStore.Text = objStore.StoreDescription; txtDepartment.Text = objStore.StoreDepartment.DepName; LoadBasicProducts(); Load_BinCard(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void frmGRNApproval_Load(object sender, EventArgs e) { try { objStore = objStoreDL.Get("Rejects"); txtStore.Text = objStore.StoreDescription; DataTable dtGRN = new DataTable(); dtGRN = objGRNDL.GetDataView(objStore.StoreID, GRN.Status.Initial); bindGRNList.DataSource = dtGRN; gvGRNList.AutoGenerateColumns = false; gvGRNList.DataSource = bindGRNList; bindGRNList.ResetBindings(true); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnSubmit_Click(object sender, EventArgs e) { if (cmbTerritory.SelectedIndex != -1) { try { if (dgvProduct.Rows.Count > 0) { objStore = objStoreDL.Get(txtStore.Text); objGRN.GRNApprovedBy = "N/A"; objGRN.GRNApprovedDate = DateTime.Now; objGRN.GRNDate = DateTime.Now; objGRN.GRNEnterdBy = CurrentUser.UserEmp.EmployeeID; objGRN.GRNType = GRN.Type.FinishProduct; // objGRN.GRNMR = objMR; //objGRN.GRNMTNNo = objMTN; objGRN.GRNRPDBatch = "N/A"; objGRN.GRNStatus = GRN.Status.Initial; objGRN.GRNStore = objStore; objGRN.GRNCategory = 0; objGRN_Payment.InvoiceNo = "N/A"; objGRN_Payment.PONo = "N/A"; objGRN_Payment.Supplier = "N/A"; objGRN_Payment.InvoiceType = "N/A"; if ((objGRN_Payment.PONo == "") | (objGRN_Payment.InvoiceNo == "") | (objGRN_Payment.Supplier == "")) { MessageBox.Show(this, "Can Not Allow to GRN", "Missing PO/Invoice/Supplier", MessageBoxButtons.OK, MessageBoxIcon.Warning); } { objGRN.GRNNo = objGRNDL.Add_Direct(objGRN); objGRN_Payment.GRNNo = objGRN.GRNNo; // objGRN_Payment_DL.Add(objGRN_Payment); objFinishGoodsReturn_DL.Add(objGRN.GRNNo, cmbCustomer.SelectedValue.ToString(), Convert.ToInt32(cmbTerritory.SelectedValue.ToString())); // } if (objGRN.GRNNo > 0) { foreach (DataGridViewRow dr in dgvProduct.Rows) { String tempproductCode = dr.Cells[0].Value.ToString(); String tempproduct = dr.Cells[1].Value.ToString(); long tempqty = Convert.ToInt64(dr.Cells[2].Value.ToString()); string tempstore = dr.Cells[3].Value.ToString(); objFinishProduct.FinishProductCode = tempproductCode; objGRNFinishProduct.NetQty = tempqty; objGRNFinishProduct.GrossQty = tempqty; objGRNFinishProduct.GRN = objGRN; objGRNFinishProduct.Remarks = "No"; objGRNFinishProduct.UnitPrice = 55; objGRNFinishProduct.FinishProducts = objFinishProduct; objGRNFinishProductDL.Add(objGRNFinishProduct); //obj.GRN = objGRN; //objGRNMaterialsDL.Add(obj); //objGRNFinishProduct } clear(); MessageBox.Show(this, "Suceessfully add to the Dispose Stock", "Successfull", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } } else { MessageBox.Show(this, "There are no Items in the List, Please add Items before Continue", "Item List Empty", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show(this, "Please Select Customer", "MRP System", MessageBoxButtons.OK, MessageBoxIcon.Error); } }