public long Add_FinishedGoodsReturns(MTN obj) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNEnterdBy", obj.MTNEnterdBy.EmployeeID), new SqlParameter("@MTNFromDepID", obj.MTNDepartmentFrom.DepID), new SqlParameter("@MTNToDepID", obj.MTNDepartmentTo.DepID), new SqlParameter("@MTNStatus", obj.MTNStatus), new SqlParameter("@MTNType", obj.MTNType), new SqlParameter("@MTNItemType", obj.MTNItemType), new SqlParameter("@Store", obj.MTNStore.StoreID), new SqlParameter("@outParam", SqlDbType.Int) { Direction = ParameterDirection.Output } }; return(Execute.RunSP_Output(Connection, "SPADD_MTN_FinishedGoodsReturns", paramList)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public int CreateBasicProductTransfer_Basic_toRPD(MTN obj, string BasicProductCode, decimal BasicQty, MTN.Status MTNRejectStatus, Batch.Status BatchStatusTransferred) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNBatchID", obj.MTNBatch), new SqlParameter("@MTNEnterdBy", obj.MTNEnterdBy.EmployeeID), new SqlParameter("@MTNToDepID", obj.MTNDepartmentTo.DepID), new SqlParameter("@MTNStatus", obj.MTNStatus), new SqlParameter("@MTNType", obj.MTNType), new SqlParameter("@MTNItemType", obj.MTNItemType), new SqlParameter("@BasicProductCode", BasicProductCode), new SqlParameter("@Qty", BasicQty), new SqlParameter("@MTNStatus_Reject", (int)MTNRejectStatus), new SqlParameter("@BatchStatus_Transferred", (int)BatchStatusTransferred), new SqlParameter("@outParam", SqlDbType.Int) { Direction = ParameterDirection.Output } }; return(Execute.RunSP_Output(Connection, "SPADD_MTN_BasicProductTransfer_Basic", paramList)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public int Update(MTN obj, long OriginalMTNNO) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNBatchID", obj.MTNBatch), new SqlParameter("@MTNDate", obj.MTNDate), new SqlParameter("@MTNApprovedBy", obj.MTNApprovedBy.EmployeeID), new SqlParameter("@MTNApproveDate", obj.MTNApprovedDate), new SqlParameter("@MTNEnterdBy", obj.MTNEnterdBy.EmployeeID), new SqlParameter("@MTNFromDepID", obj.MTNDepartmentFrom.DepID), new SqlParameter("@MTNToDepID", obj.MTNDepartmentTo.DepID), new SqlParameter("@MTNReceivedBy", obj.MTNReceivedBy.EmployeeID), new SqlParameter("@MTNReceivedDate", obj.MTNReceivedDate), new SqlParameter("@MTNStatus", obj.MTNStatus), new SqlParameter("@MTNType", obj.MTNType), new SqlParameter("@MTNItemType", obj.MTNItemType), new SqlParameter("@MTNStore", obj.MTNStore.StoreID), new SqlParameter("@Original_MTNNO", OriginalMTNNO) }; return(Execute.RunSP_RowsEffected(Connection, "SPADD_MR", paramList)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public int CreatePackingMTN_Secondary_toStores(MTN obj, BatchActivity.Status Status, string FinishProductCode, int Qty, BatchActivity.Status BatchActStatus_Finished, BatchActivity.Status BatchActStatus_Secondary) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNPackingBatch", obj.PackingBatch), new SqlParameter("@MTNEnterdBy", obj.MTNEnterdBy.EmployeeID), new SqlParameter("@MTNToDepID", obj.MTNDepartmentTo.DepID), new SqlParameter("@MTNStatus", obj.MTNStatus), new SqlParameter("@MTNType", obj.MTNType), new SqlParameter("@MTNItemType", obj.MTNItemType), new SqlParameter("@FinishProductCode", FinishProductCode), new SqlParameter("@Qty", Qty), new SqlParameter("@NextBatchActivityStatus", Convert.ToInt32(Status)), new SqlParameter("@BatchActStatus_Finished", Convert.ToInt32(BatchActStatus_Finished)), new SqlParameter("@BatchActStatus_Secondary", Convert.ToInt32(BatchActStatus_Secondary)), new SqlParameter("@outParam", SqlDbType.Int) { Direction = ParameterDirection.Output } }; return(Execute.RunSP_Output(Connection, "SPADD_MTN_Packing_Secondary", paramList)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
private void btnGRN_Click(object sender, EventArgs e) { try { objMTN = objMTNDL.Get(objMTN.MTNNo); if (objMTN.MTNStatus == MTN.Status.Cost) { if ((objMTN != null) && (objStore != null)) { if (objMTN.MTNItemType == MTN.ItemType.Material) { PRPDBatch_DL objPRPDBatch_DL = new PRPDBatch_DL(ConnectionStringClass.GetConnection()); PRPDBatch objPRPDBatch = objPRPDBatch_DL.Get(gvMTNList.CurrentRow.Cells["BatchID"].Value.ToString()); if (objPRPDBatch.Type == PRPDBatch.PRPDType.Rework) { objStore = objStoreDL.Get("RM_Main"); long GRNNO = objMTNDL.AddGRN(objMTN.MTNNo, MTN.Status.ReceviedGRN, CurrentUser.EmployeeID, objStore.StoreID, GRN.Type.Material, GRN.Status.Initial); MessageBox.Show(this, "Successfully Raised a GRN. The GRNNO is : " + GRNNO.ToString(), "Successful", MessageBoxButtons.OK); } else { long GRNNO = objMTNDL.AddGRN(objMTN.MTNNo, MTN.Status.ReceviedGRN, CurrentUser.EmployeeID, objStore.StoreID, GRN.Type.Material, GRN.Status.Initial); MessageBox.Show(this, "Successfully Raised a GRN. The GRNNO is : " + GRNNO.ToString(), "Successful", MessageBoxButtons.OK); } } else if (objMTN.MTNItemType == MTN.ItemType.Basic_Product) { long GRNNO = objMTNDL.AddGRN(objMTN.MTNNo, MTN.Status.ReceviedGRN, CurrentUser.EmployeeID, objStore.StoreID, GRN.Type.BasicProduct, GRN.Status.Initial); MessageBox.Show(this, "Successfully Raised a GRN. The GRNNO is : " + GRNNO.ToString(), "Successful", MessageBoxButtons.OK); } else if (objMTN.MTNItemType == MTN.ItemType.Finish_Product) { long GRNNO = objMTNDL.AddGRN(objMTN.MTNNo, MTN.Status.ReceviedGRN, CurrentUser.EmployeeID, objStore.StoreID, GRN.Type.FinishProduct, GRN.Status.Initial); MessageBox.Show(this, "Successfully Raised a GRN. The GRNNO is : " + GRNNO.ToString(), "Successful", MessageBoxButtons.OK); } bindMTNList.DataSource = objMTNDL.Get_From_PRPD_Batches(Convert.ToInt64(MTN.Type.PRPD), Convert.ToInt32(MTN.Status.Cost)); if (gvMTNList.Rows.Count > 0) { DataGridViewCellEventArgs dr = new DataGridViewCellEventArgs(1, 0); gvMTNList_CellClick(sender, dr); } else { bindItemList.DataSource = null; } } } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void gvMTNList_CellClick(object sender, DataGridViewCellEventArgs e) { try { long MTNNO = Convert.ToInt64(gvMTNList.CurrentRow.Cells[0].Value); objMTN = objMTNDL.Get(MTNNO); bindItemList.DataSource = objMTNDL.GetDataView(MTNNO); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnTransferBP_Click(object sender, EventArgs e) { try { DialogResult theResult = MessageBox.Show(this, "Do You Need to Transfer Basic Product to RPD Stores", "Confirmation", MessageBoxButtons.YesNo); if (theResult == System.Windows.Forms.DialogResult.Yes) { DataTable dtReports = objQCReport_DL.Get_IsManufacturingQCPass(objBatch.BatchID, Convert.ToInt32(QCReport.ReportStatus.Accept)); if (dtReports.Rows.Count > 0) { MTN objMTN = new MTN(); objMTN.MTNBatch = Convert.ToString(dgvBatcList.CurrentRow.Cells["BatchNo"].Value); objMTN.MTNEnterdBy = objEmployee_DL.Get(CurrentUser.EmployeeID); objMTN.MTNDepartmentTo = objDepartment_DL.GetByDepType("RPD"); objMTN.MTNStatus = MTN.Status.Initial; objMTN.MTNType = MTN.Type.Batch; objMTN.MTNItemType = MTN.ItemType.Basic_Product; //int i = objMTN_DL.CreateBasicProductTransfer_toRPD(objMTN, BatchActivity.Status.Transferred, objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, Convert.ToDecimal(txtBasicQty.Text)); //if (i > 0) //{ // MessageBox.Show(this, "Successfully sent to Stores. MTN No is :" + i.ToString(), "Successful", MessageBoxButtons.OK); //} //Load_Activity(); //if (dgvBatcList.Rows.Count > 0) //{ // DataGridViewCellEventArgs dr = new DataGridViewCellEventArgs(1, 0); // dgvBatcList_CellClick(sender, dr); // dgvActivity_CellClick(sender, dr); //} } else { MessageBox.Show(this, "Packing QC is Not Passed", "Can not Proceed", MessageBoxButtons.OK); } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
public override void LoadContent(bool firstLoad) { // Check if the current input GUI override is still valid. If so, apply it. if (!string.IsNullOrEmpty(Settings.InputGui)) { string inputGuiPath = $"controls/{Settings.InputGui}/"; if (GFX.Gui.GetTextures().Any(kvp => kvp.Key.StartsWith(inputGuiPath))) { Input.OverrideInputPrefix = Settings.InputGui; } else { Settings.InputGui = ""; } } if (firstLoad && !Everest.Flags.AvoidRenderTargets) { SubHudRenderer.Buffer = VirtualContent.CreateRenderTarget("subhud-target", 1922, 1082); } if (Everest.Flags.AvoidRenderTargets && Celeste.HudTarget != null) { Celeste.HudTarget.Dispose(); Celeste.HudTarget = null; } if (Settings.NonThreadedGL) { GFX.Load(); MTN.Load(); GFX.LoadData(); MTN.LoadData(); } // Otherwise loaded in GameLoader.LoadThread // Celeste 1.3.0.0 gets rid of those. for (int i = 0; i <= 29; i++) { GFX.Game[$"objects/checkpoint/flag{i:D2}"] = GFX.Game["util/pixel"]; } for (int i = 0; i <= 27; i++) { GFX.Game[$"objects/checkpoint/obelisk{i:D2}"] = GFX.Game["util/pixel"]; } GFX.Gui["fileselect/assist"] = GFX.Game["util/pixel"]; GFX.Gui["fileselect/cheatmode"] = GFX.Game["util/pixel"]; }
private void gvMTNList_CellClick_1(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { try { long MTNNO = Convert.ToInt64(gvMTNList.Rows[e.RowIndex].Cells[0].Value); objMTN = objMTNDL.Get(MTNNO); bindMaterialList.DataSource = objMTNDL.GetDataView(MTNNO); } catch (Exception ex) { MessageBox.Show(this, "Error occured while loading Item List", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnGRN_Click(object sender, EventArgs e) { try { objMTN = objMTNDL.Get(objMTN.MTNNo); if (objMTN.MTNStatus == MTN.Status.Cost) { if ((objMTN != null) && (objStore != null)) { if (objMTN.MTNItemType == MTN.ItemType.Material) { long GRNNO = objMTNDL.AddGRN(objMTN.MTNNo, MTN.Status.ReceviedGRN, CurrentUser.EmployeeID, objStore.StoreID, GRN.Type.Material, GRN.Status.Initial); MessageBox.Show(this, "Successfully Raised a GRN. The GRNNO is : " + GRNNO.ToString(), "Successful", MessageBoxButtons.OK); } else if (objMTN.MTNItemType == MTN.ItemType.Basic_Product) { long GRNNO = objMTNDL.AddGRN(objMTN.MTNNo, MTN.Status.ReceviedGRN, CurrentUser.EmployeeID, objStore.StoreID, GRN.Type.BasicProduct, GRN.Status.Initial); MessageBox.Show(this, "Successfully Raised a GRN. The GRNNO is : " + GRNNO.ToString(), "Successful", MessageBoxButtons.OK); } else if (objMTN.MTNItemType == MTN.ItemType.Finish_Product) { long GRNNO = objMTNDL.AddGRN(objMTN.MTNNo, MTN.Status.ReceviedGRN, CurrentUser.EmployeeID, objStore.StoreID, GRN.Type.FinishProduct, GRN.Status.Initial); MessageBox.Show(this, "Successfully Raised a GRN. The GRNNO is : " + GRNNO.ToString(), "Successful", MessageBoxButtons.OK); } bindMTNList.DataSource = objMTNDL.Get_Basic_Transfers(Convert.ToInt64(MTN.Type.Batch), Convert.ToInt32(MTN.Status.Cost), Convert.ToInt32(MTN.ItemType.Basic_Product)); if (gvMTNList.Rows.Count > 0) { DataGridViewCellEventArgs dr = new DataGridViewCellEventArgs(1, 0); gvMTNList_CellClick(sender, dr); } else { bindItemList.DataSource = null; } } } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadThread() { MInput.Disabled = true; MainThreadHelper.Boost = 25; Stopwatch timer = Stopwatch.StartNew(); Audio.Init(); // Original code loads audio banks here. Settings.Instance.ApplyVolumes(); audioLoaded = true; Console.WriteLine(" - AUDIO LOAD: " + timer.ElapsedMilliseconds + "ms"); timer.Stop(); GFX.Load(); MTN.Load(); GFX.LoadData(); MTN.LoadData(); timer = Stopwatch.StartNew(); Fonts.Prepare(); Dialog.Load(); Fonts.Load(Dialog.Languages["english"].FontFace); Fonts.Load(Dialog.Languages[Settings.Instance.Language].FontFace); dialogLoaded = true; Console.WriteLine(" - DIA/FONT LOAD: " + timer.ElapsedMilliseconds + "ms"); timer.Stop(); MInput.Disabled = false; timer = Stopwatch.StartNew(); AreaData.Load(); Console.WriteLine(" - LEVELS LOAD: " + timer.ElapsedMilliseconds + "ms"); timer.Stop(); timer = Stopwatch.StartNew(); MainThreadHelper.Boost = 50; patch_VirtualTexture.WaitFinishFastTextureLoading(); MainThreadHelper.Get(() => MainThreadHelper.Boost = 0).GetResult(); // FIXME: There could be ongoing tasks which add to the main thread queue right here. Console.WriteLine(" - FASTTEXTURELOADING LOAD: " + timer.ElapsedMilliseconds + "ms"); timer.Stop(); Console.WriteLine("DONE LOADING (in " + Celeste.LoadTimer.ElapsedMilliseconds + "ms)"); Celeste.LoadTimer.Stop(); Celeste.LoadTimer = null; loaded = true; }
public int Update(MTN obj) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNApprovedBy", obj.MTNApprovedBy.EmployeeID), new SqlParameter("@Status", obj.MTNStatus), new SqlParameter("@MTNNO", obj.MTNNo) }; return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_MTN_Status", paramList)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MTNCollec Get(long FromDepID, MTN.Status Status) { Employee_DL objEmployee_DL = new Employee_DL(Connection); Department_DL objDepartment_DL = new Department_DL(Connection); MTNCollec objMTNCollec = new MTNCollec(); Store_DL objStore_DL = new Store_DL(Connection); GRN_DL objGRN_DL = new GRN_DL(Connection); try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@DepID", FromDepID), new SqlParameter("@MTNStatus", Status) }; DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_MTN_ByFromDep_Status", paramList); for (int i = 0; i < dt.Rows.Count; i++) { MTN objMTN = new MTN(); objMTN.MTNApprovedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["MTNApprovedBy"])); objMTN.MTNApprovedDate = Convert.ToDateTime(dt.Rows[i]["MTNApproveDate"]); objMTN.MTNBatch = "No"; objMTN.MTNDate = Convert.ToDateTime(dt.Rows[i]["MTNDate"]); objMTN.MTNDepartmentFrom = objDepartment_DL.Get(Convert.ToInt64(dt.Rows[i]["MTNFromDepID"])); objMTN.MTNDepartmentTo = objDepartment_DL.Get(Convert.ToInt64(dt.Rows[i]["MTNToDepID"])); objMTN.MTNEnterdBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["MTNEnterdBy"])); objMTN.MTNNo = Convert.ToInt64(dt.Rows[i]["MTNNo"]); objMTN.MTNReceivedBy = objEmployee_DL.Get(Convert.ToString(dt.Rows[i]["MTNReceivedBy"])); objMTN.MTNReceivedDate = Convert.ToDateTime(dt.Rows[i]["MTNReceivedDate"]); objMTN.MTNStatus = (MTN.Status)dt.Rows[i]["MTNStatus"]; objMTN.MTNType = (MTN.Type)dt.Rows[i]["MTNType"]; objMTN.MTNItemType = (MTN.ItemType)dt.Rows[i]["MTNItemType"]; objMTN.MTNStore = objStore_DL.Get(Convert.ToString(dt.Rows[i]["MTNStore"])); objMTNCollec.Add(objMTN); } return(objMTNCollec); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
private void gvMTNList_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { try { objMTN = objMTNDL.Get(Convert.ToInt64(gvMTNList.Rows[e.RowIndex].Cells["colMTN"].Value)); if (objMTN != null) { bindItemList.DataSource = objMTNDL.GetDataView(objMTN.MTNNo); } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public long RemoveStock(MTN obj) { try { SqlParameter[] paramList = new SqlParameter[] { new SqlParameter("@MTNEnterdBy", obj.MTNEnterdBy.EmployeeID), new SqlParameter("@MTNFromDepID", obj.MTNDepartmentFrom.DepID), new SqlParameter("@MTNToDepID", obj.MTNDepartmentTo.DepID), new SqlParameter("@MTNStatus", obj.MTNStatus), new SqlParameter("@MTNType", obj.MTNType), new SqlParameter("@MTNItemType", obj.MTNItemType) }; return(Execute.RunSP_RowsEffected(Connection, "SPADD_MTN_RemoveStock", paramList)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
private void gvMTNList_CellClick(object sender, DataGridViewCellEventArgs e) { try { long MTNNO = Convert.ToInt64(gvMTNList.CurrentRow.Cells["MTNNO"].Value); objMTN = objMTNDL.Get(MTNNO); DataTable dtItemList = objMTNDL.GetDataView(MTNNO); gvItemList.AutoGenerateColumns = false; bindItemList.DataSource = dtItemList; gvItemList.DataSource = bindItemList; bindItemList.ResetBindings(true); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadThread() { MInput.Disabled = true; Stopwatch timer = Stopwatch.StartNew(); Audio.Init(); // Original code loads audio banks here. Settings.Instance.ApplyVolumes(); audioLoaded = true; Console.WriteLine(" - AUDIO LOAD: " + timer.ElapsedMilliseconds + "ms"); timer.Stop(); if (!CoreModule.Settings.NonThreadedGL) { GFX.Load(); MTN.Load(); GFX.LoadData(); MTN.LoadData(); } // Otherwise loaded in CoreModule.LoadContent timer = Stopwatch.StartNew(); Fonts.Prepare(); Dialog.Load(); Fonts.Load(Dialog.Languages["english"].FontFace); Fonts.Load(Dialog.Languages[Settings.Instance.Language].FontFace); dialogLoaded = true; Console.WriteLine(" - DIA/FONT LOAD: " + timer.ElapsedMilliseconds + "ms"); timer.Stop(); MInput.Disabled = false; timer = Stopwatch.StartNew(); AreaData.Load(); Console.WriteLine(" - LEVELS LOAD: " + timer.ElapsedMilliseconds + "ms"); timer.Stop(); Console.WriteLine("DONE LOADING (in " + Celeste.LoadTimer.ElapsedMilliseconds + "ms)"); Celeste.LoadTimer.Stop(); Celeste.LoadTimer = null; loaded = true; }
private void btnSendToStore_Click(object sender, EventArgs e) { try { DataTable dtReports = objQCReport_DL.Get_IsPackingQCPass(dgvActivity.CurrentRow.Cells["BatchID"].Value.ToString(), Convert.ToInt32(QCReport.ReportStatus.Accept), "Packing_Secondary"); if (dtReports.Rows.Count > 0) { MTN objMTN = new MTN(); objMTN.PackingBatch = Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value); objMTN.MTNEnterdBy = objEmployee_DL.Get(CurrentUser.EmployeeID); objMTN.MTNDepartmentTo = objDepartment_DL.GetByDepType("STORE"); objMTN.MTNStatus = MTN.Status.Initial; objMTN.MTNType = MTN.Type.Packing; objMTN.MTNItemType = MTN.ItemType.Finish_Product; int i = objMTN_DL.CreatePackingMTN_Secondary_toStores(objMTN, BatchActivity.Status.Transferred, dgvActivity.CurrentRow.Cells["SecondaryFinishProduct"].Value.ToString(), Convert.ToInt32(dgvActivity.CurrentRow.Cells["Qty"].Value), BatchActivity.Status.Finished, BatchActivity.Status.SecondaryPacking); if (i > 0) { MessageBox.Show(this, "Successfully sent to Stores. MTN No is :" + i.ToString(), "Successful", MessageBoxButtons.OK); } objBatch_DL.Update_Packed(dgvActivity.CurrentRow.Cells["BatchID"].Value.ToString(), (int)Batch.Status.Packed, (int)BatchActivity.Status.Transferred, (int)MTN.Status.Reject); //objBatch_DL.Update_BatchPackingCost(objBatchActivity.BatchActID); objBatch_DL.Update_BatchSeconderyPackingCost(objBatchActivity.BatchActID); Load_Activity(); } else { MessageBox.Show(this, "Packing QC is Not Passed", "Can not Proceed", MessageBoxButtons.OK); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void btnCostReport_Click(object sender, EventArgs e) { try { MTN obj = new MTN(); obj = objMTNDL.Get(Convert.ToInt64(gvMTNList.CurrentRow.Cells["Column1"].Value)); if (obj.MTNType == MTN.Type.Batch) { MRP_GUI.Report.frmRptProductionCost objForm = new Report.frmRptProductionCost(Convert.ToString(gvMTNList.CurrentRow.Cells["BatchID"].Value)); objForm.Show(); } else { MRP_GUI.Report.frmRptManufactPackCost objForm = new Report.frmRptManufactPackCost(Convert.ToInt64(gvMTNList.CurrentRow.Cells["PackingID"].Value)); objForm.Show(); } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnTransfer_Click(object sender, EventArgs e) { try { if (objPRPDBatch.Type != PRPDBatch.PRPDType.Rework) { if (objProcessed.MaterialCode != "") { MTN objMTN = new MTN(); objMTN.MTNDate = DateTime.Today; objMTN.MTNDepartmentFrom = objDepartment_DL.GetByDepType("PRPD"); objMTN.MTNDepartmentFromName = objMTN.MTNDepartmentFrom.DepName; objMTN.MTNDepartmentTo = objDepartment_DL.GetByDepType("Store"); objMTN.MTNEnterdBy = objEmployee_DL.Get(CurrentUser.EmployeeID); objMTN.MTNItemType = MTN.ItemType.Material; objMTN.MTNStatus = MTN.Status.Initial; objMTN.MTNType = MTN.Type.PRPD; int ID = objMTN_DL.Add_PRPDTransfer(objMTN); if (ID > 0) { objMTN.MTNNo = ID; MTNMaterial objMTNMat = new MTNMaterial(); objMTNMat.Description = "PRPD batch Transfer"; objMTNMat.Material = objProcessed; objMTNMat.MTN = objMTN; objMTNMat.TransferQty = objPRPDBatch.PRPDBatchFinalQty; objMTNMat.UnitRate = objPRPDBatch_DL.UnitPrice(objPRPDBatch.PRPDBatchID); objMTNMat.Batch = "No"; int res = objMTNMaterial_DL.Add(objMTNMat); if (res > 0) { objPRPDBatch.UnitCost = objPRPDBatch_DL.UnitPrice(objPRPDBatch.PRPDBatchID); objPRPDBatch.Status = PRPDBatch.PRPDBatchStatus.Transfered; objPRPDBatch.PRPDBatchHandOverBy = CurrentUser.UserEmp; objPRPDBatch.PRPDBatchMTNOUT = objMTN; objPRPDBatch_DL.Update_Transfer(objPRPDBatch); MessageBox.Show(this, "Successfully Transferd, MTN No :- " + objMTN.MTNNo.ToString(), "Successful", MessageBoxButtons.OK, MessageBoxIcon.Warning); Clear(); this.frmPRPDBatchTransfer_Preperation_Load(sender, e); } } } else { MessageBox.Show(this, "There are no Processed Materials", "Invalid Material", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MTN objMTN = new MTN(); objMTN.MTNDate = DateTime.Today; objMTN.MTNDepartmentFrom = objDepartment_DL.GetByDepType("PRPD"); objMTN.MTNDepartmentFromName = objMTN.MTNDepartmentFrom.DepName; objMTN.MTNDepartmentTo = objDepartment_DL.GetByDepType("Store"); objMTN.MTNEnterdBy = objEmployee_DL.Get(CurrentUser.EmployeeID); objMTN.MTNItemType = MTN.ItemType.Material; objMTN.MTNStatus = MTN.Status.Initial; objMTN.MTNType = MTN.Type.PRPD; int ID = objMTN_DL.Add_PRPDTransfer(objMTN); if (ID > 0) { objMTN.MTNNo = ID; MTNMaterial objMTNMat = new MTNMaterial(); objMTNMat.Description = "PRPD batch Transfer"; objMTNMat.Material = objProcessed; objMTNMat.MTN = objMTN; objMTNMat.TransferQty = objPRPDBatch.PRPDBatchFinalQty; objMTNMat.UnitRate = objPRPDBatch_DL.UnitPrice(objPRPDBatch.PRPDBatchID); objMTNMat.Batch = "No"; int res = objMTNMaterial_DL.Add(objMTNMat); if (res > 0) { objPRPDBatch.UnitCost = objPRPDBatch_DL.UnitPrice(objPRPDBatch.PRPDBatchID); objPRPDBatch.Status = PRPDBatch.PRPDBatchStatus.Transfered; objPRPDBatch.PRPDBatchHandOverBy = CurrentUser.UserEmp; objPRPDBatch.PRPDBatchMTNOUT = objMTN; objPRPDBatch_DL.Update_Transfer(objPRPDBatch); MessageBox.Show(this, "Successfully Transferd, MTN No :- " + objMTN.MTNNo.ToString(), "Successful", MessageBoxButtons.OK, MessageBoxIcon.Warning); Clear(); this.frmPRPDBatchTransfer_Preperation_Load(sender, e); } } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
private void btnReceive_Click(object sender, EventArgs e) { try { bool CanSubmit = true; for (int i = 0; i < gvItemList.Rows.Count; i++) { if (gvItemList.Rows[i].Cells["UnitCost"].Value.ToString() == "") { CanSubmit = false; break; } } if (chkBudget.Checked == true) { if (CanSubmit == true) { DialogResult theResult = MessageBox.Show(this, "Do you want to Send this MTN with Budgeted Costing", "Confirmation", MessageBoxButtons.YesNo); if (theResult == System.Windows.Forms.DialogResult.Yes) { objMTNDL.Budget_Cost(MTN.Status.Cost, objMTN.MTNNo, CurrentUser.EmployeeID); } } else { MessageBox.Show("Cost Can not be Null"); } } else { DialogResult theResult = MessageBox.Show(this, "Do you want to Send this MTN with System Generated Costing", "Confirmation", MessageBoxButtons.YesNo); if (theResult == System.Windows.Forms.DialogResult.Yes) { objMTNDL.Actual_Cost(MTN.Status.Cost, objMTN.MTNNo, CurrentUser.EmployeeID); } } Load_Data(); if (gvMTNList.Rows.Count > 0) { long MTNNO = Convert.ToInt64(gvMTNList.CurrentRow.Cells[0].Value); objMTN = objMTNDL.Get(MTNNO); bindItemList.DataSource = objMTNDL.GetDataView(MTNNO); } else { bindItemList.DataSource = null; } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmViewPRPDBatch_Load(object sender, EventArgs e) { try { Load_Activity(); Load_QC(); Load_Instructions(); //bool IsStart = false; if (objPRPDBatch.Type == PRPDBatch.PRPDType.Rework) { lblTitle.Text = "Rework - " + objPRPDBatch.PRPDBatchID; MTN obj = objMTN_DL.Get(objPRPDBatch.PRPDBatchMTNIN); txtNote.Text = obj.MTNNo.ToString() + " - " + obj.MTNStatus.ToString(); lblNote.Text = "MTN NO"; } else if (objPRPDBatch.Type == PRPDBatch.PRPDType.PrimaryOutsource) { lblTitle.Text = "Primary Outsource - " + objPRPDBatch.PRPDBatchID; MTN obj = objMTN_DL.Get(objPRPDBatch.PRPDBatchMTNIN); txtNote.Text = obj.MTNNo.ToString() + " - " + obj.MTNStatus.ToString(); lblNote.Text = "MTN NO"; } else if (objPRPDBatch.Type == PRPDBatch.PRPDType.PrimaryPreperation) { lblTitle.Text = "Preperation - " + objPRPDBatch.PRPDBatchID; MR obj = objMR_DL.Get(objPRPDBatch.MRIN); txtNote.Text = obj.MRNO.ToString() + " - " + obj.MRStatus.ToString(); lblNote.Text = "MR NO"; } dtMainActtivity_PRPD = objMainActivity_DL.Get_Data_PRPD_Activity(objPRPDBatch.PRPDBatchID); //objPRPDBatch = objPRPDBatch_DL.Get(cmbPRPDBatchID.SelectedValue.ToString()); txtMaterial.Text = objPRPDBatch.PRPDBatchMaterialName; txtInstructedBy.Text = objPRPDBatch.PRPDBatchInstructedBy.EmployeeName; txtQuantity.Text = objPRPDBatch.PRPDBatchQty.ToString(); //Load Instructions dtPRPDBatchActivityInstructions = objPRPDBatchActivityInstructions_DL.GetDataByBatchID(objPRPDBatch.PRPDBatchID); objSourceActInstructions.DataSource = dtPRPDBatchActivityInstructions; objSourceActInstructions.ResetBindings(true); txtBatchState.Text = Enum.GetName(typeof(PRPDBatch.PRPDBatchStatus), objPRPDBatch.Status).ToString(); lblUnit.Text = objPRPDBatch.PRPDBatchMaterial.MatUnit.UnitCode; lblUnit1.Text = objPRPDBatch.PRPDBatchMaterial.MatUnit.UnitCode; lblUnit2.Text = objPRPDBatch.PRPDBatchMaterial.MatUnit.UnitCode; lblUnit3.Text = objPRPDBatch.PRPDBatchMaterial.MatUnit.UnitCode; txtDate.Text = objPRPDBatch.PRPDBatchStartDate.ToShortDateString(); txtBatchNo.Text = objPRPDBatch.PRPDBatchID; txtCreateDate.Text = objPRPDBatch.PRPDBatchInstructedDate.ToShortDateString(); txtSupervisedBy.Text = objPRPDBatch.PRPDBatchSuperviser.EmployeeNameID; txtHandedOver.Text = objPRPDBatch.PRPDBatchHandOverBy.EmployeeNameID; txtInspected.Text = objPRPDBatch.PRPDBatchInspectedBy.EmployeeNameID; txtFinalQty.Text = objPRPDBatch.PRPDBatchFinalQty.ToString(); txtImpurities.Text = objPRPDBatch.PRPDBatchTotalImpurities.ToString(); txtSampleSize.Text = objPRPDBatch.PRPDSampleSize.ToString(); if (objPRPDBatch.Status == PRPDBatch.PRPDBatchStatus.Finished || objPRPDBatch.Status == PRPDBatch.PRPDBatchStatus.Transfered) { btnCost.Enabled = true; } else { btnCost.Enabled = false; } } catch (Exception ex) { MessageBox.Show(this, "Error occured while loading", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnSendToStore_Click(object sender, EventArgs e) { try { DataTable dtReports = objQCReport_DL.Get_IsPackingQCPass(objBatch.BatchID, Convert.ToInt32(QCReport.ReportStatus.Accept), "Rework"); if (dtReports.Rows.Count > 0) { MTN objMTN = new MTN(); objMTN.PackingBatch = Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value); objMTN.MTNEnterdBy = objEmployee_DL.Get(CurrentUser.EmployeeID); objMTN.MTNDepartmentTo = objDepartment_DL.GetByDepType("STORE"); objMTN.MTNStatus = MTN.Status.Initial; objMTN.MTNType = MTN.Type.Packing; objMTN.MTNItemType = MTN.ItemType.Finish_Product; int i = objMTN_DL.CreatePackingMTN_toStores(objMTN, BatchActivity.Status.Transferred, dgvActivity.CurrentRow.Cells["SecondaryFinishProduct"].Value.ToString(), Convert.ToInt32(dgvActivity.CurrentRow.Cells["Qty"].Value), BatchActivity.Status.Finished, BatchActivity.Status.SecondaryPacking); if (i > 0) { MessageBox.Show(this, "Successfully sent to Stores. MTN No is :" + i.ToString(), "Successful", MessageBoxButtons.OK); } else { MessageBox.Show(this, "Invalid Qty", "Unsuccessful", MessageBoxButtons.OK); } Load_Activity(); if (dgvBatcList.Rows.Count > 0) { if (dgvActivity.Rows.Count > 0) { DataGridViewCellEventArgs dr = new DataGridViewCellEventArgs(1, 0); dgvBatcList_CellClick(sender, dr); dgvActivity_CellClick(sender, dr); } else { dgvBatchLabourDetails.AutoGenerateColumns = false; objSourceBatchLabour.DataSource = null; dgvBatchLabourDetails.DataSource = objSourceBatchLabour; objSourceBatchLabour.ResetBindings(true); } } objBatch_DL.Update_Packed(objBatch.BatchID, (int)Batch.Status.Packed, (int)BatchActivity.Status.Transferred, (int)MTN.Status.Reject); txtTransferQty.Text = ""; } else { MessageBox.Show(this, "Packing QC is Not Passed", "Can not Proceed", MessageBoxButtons.OK); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Master.HeadingMessage("Material Details(" + Request.QueryString["MAT_CODE1"] + ")"); MR.MasterTableView.AllowPaging = false; MR.Rebind(); decimal mr_sum = WebTools.DSum("MR_QTY", "VIEW_MAT_REQUISITION", "CLIENT_PART_NO='" + Request.QueryString["MAT_CODE1"] + "'"); lblMrCnt.Text = "Count :" + MR.MasterTableView.Items.Count.ToString(); lblMrSum.Text = "Sum :" + mr_sum.ToString(); PO.MasterTableView.AllowPaging = false; PO.Rebind(); decimal po_sum = WebTools.DSum("PO_QTY", "VIEW_PO_REPORT_MAIN", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblPoCnt.Text = "Count :" + PO.MasterTableView.Items.Count.ToString(); lblPoSum.Text = "Sum :" + po_sum.ToString(); Batch.MasterTableView.AllowPaging = false; Batch.Rebind(); decimal batch_sum = WebTools.DSum("BATCH_QTY", "VIEW_PO_BATCH_PLAN_DETAIL", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblBatchCnt.Text = "Count :" + Batch.MasterTableView.Items.Count.ToString(); lblBatchSum.Text = "Sum :" + batch_sum.ToString(); IRN.MasterTableView.AllowPaging = false; IRN.Rebind(); decimal irn_sum = WebTools.DSum("RELEASE_QTY", "VIEW_PO_IRN_DETAIL_REP", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblIrnCnt.Text = "Count :" + IRN.MasterTableView.Items.Count.ToString(); lblIrnSum.Text = "Sum :" + irn_sum.ToString(); MRR.MasterTableView.AllowPaging = false; MRR.Rebind(); decimal mrr_sum = WebTools.DSum("RECV_QTY", "VIEW_MAT_RCV_REPORT_DT", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblMrrCnt.Text = "Count :" + MRR.MasterTableView.Items.Count.ToString(); lblMrrSum.Text = "Sum :" + mrr_sum.ToString(); RFI.MasterTableView.AllowPaging = false; RFI.Rebind(); decimal rfi_sum = WebTools.DSum("INSP_QTY", "VIEW_MAT_RFI_REPORT", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblRfiCnt.Text = "Count :" + RFI.MasterTableView.Items.Count.ToString(); lblRfiSum.Text = "Sum :" + rfi_sum.ToString(); MRIR.MasterTableView.AllowPaging = false; MRIR.Rebind(); decimal mrir_sum = WebTools.DSum("ACPT_QTY", "VIEW_MAT_MRIR_REPORT", "MAT_CODE='" + Request.QueryString["MAT_CODE1"] + "'"); lblMrirCnt.Text = "Count :" + MRIR.MasterTableView.Items.Count.ToString(); lblMrirSum.Text = "Sum :" + mrir_sum.ToString(); MaterialRequest.MasterTableView.AllowPaging = false; MaterialRequest.Rebind(); decimal mat_req_sum = WebTools.DSum("REQ_QTY", "VIEW_MATERIAL_REQUEST_DT1", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblMaterialRequestCnt.Text = "Count :" + MaterialRequest.MasterTableView.Items.Count.ToString(); lblMaterialRequestSum.Text = "Sum :" + mat_req_sum.ToString(); MTN.MasterTableView.AllowPaging = false; MTN.Rebind(); decimal mtn_sum = WebTools.DSum("TRANSF_QTY", "VIEW_ADAPTER_MAT_TRANSF_DT1", "MATERIAL_CODE='" + Request.QueryString["MAT_CODE1"] + "'"); lblMtnCnt.Text = "Count :" + MTN.MasterTableView.Items.Count.ToString(); lblMtnSum.Text = "Sum :" + mtn_sum.ToString(); MTNreceive.MasterTableView.AllowPaging = false; MTNreceive.Rebind(); decimal mtn_recv_sum = WebTools.DSum("RCV_QTY", "VIEW_MAT_TRANSFER_RCV_DT", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblMtnRcvCnt.Text = "Count :" + MTNreceive.MasterTableView.Items.Count.ToString(); lblMtnRcvSum.Text = "Sum :" + mtn_recv_sum.ToString(); MIV.MasterTableView.AllowPaging = false; MIV.Rebind(); decimal miv_sum = WebTools.DSum("ISSUE_QTY", "VIEW_ADAPTER_ISSUE_ADD_DETAIL", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblMivCnt.Text = "Count :" + MIV.MasterTableView.Items.Count.ToString(); lblMivSum.Text = "Sum :" + miv_sum.ToString(); Reconcilation.MasterTableView.AllowPaging = false; Reconcilation.Rebind(); decimal recon_sum = WebTools.DSum("BAL_QTY", "VIEW_ITEM_REP_A", "MAT_CODE1='" + Request.QueryString["MAT_CODE1"] + "'"); lblReconCnt.Text = "Count :" + Reconcilation.MasterTableView.Items.Count.ToString(); lblReconSum.Text = "Sum :" + recon_sum.ToString(); } }
private void btnSendToStore_Click(object sender, EventArgs e) { try { DataTable dtReports = objQCReport_DL.Get_IsPackingQCPass(dgvActivity.CurrentRow.Cells["BatchID"].Value.ToString(), Convert.ToInt32(QCReport.ReportStatus.Accept), "Packing"); if (dtReports.Rows.Count > 0) { if (!String.IsNullOrWhiteSpace(txtTransferQty.Text) && DataValidation.IsNumericNumber(txtTransferQty.Text)) { MTN objMTN = new MTN(); objMTN.PackingBatch = Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value); objMTN.MTNEnterdBy = objEmployee_DL.Get(CurrentUser.EmployeeID); objMTN.MTNDepartmentTo = objDepartment_DL.GetByDepType("STORE"); objMTN.MTNStatus = MTN.Status.Initial; objMTN.MTNType = MTN.Type.Packing; objMTN.MTNItemType = MTN.ItemType.Finish_Product; if (Convert.ToInt32(dgvActivity.CurrentRow.Cells["RemainningQty"].Value) < Convert.ToInt32(txtTransferQty.Text)) { MessageBox.Show(this, "Invalid Qty to Transfer", "UnSuccessful", MessageBoxButtons.OK); } else { int i = objMTN_DL.CreatePackingMTN_toStores(objMTN, BatchActivity.Status.Transferred, dgvActivity.CurrentRow.Cells["SecondaryFinishProduct"].Value.ToString(), Convert.ToInt32(txtTransferQty.Text), BatchActivity.Status.Finished, BatchActivity.Status.SecondaryPacking); objBatch_DL.Update_BatchPackingCost(objBatchActivity.BatchActID); if (i > 0) { MessageBox.Show(this, "Successfully sent to Stores. MTN No is :" + i.ToString(), "Successful", MessageBoxButtons.OK); } else { MessageBox.Show(this, "Invalid Qty", "Unsuccessful", MessageBoxButtons.OK); } objBatch_DL.Update_Packed(dgvActivity.CurrentRow.Cells["BatchID"].Value.ToString(), (int)Batch.Status.Packed, (int)BatchActivity.Status.Transferred, (int)MTN.Status.Reject); Load_Batch_List(); } txtTransferQty.Text = ""; btnSendToStore.Enabled = false; } else { MessageBox.Show(this, "please enter valid quantity", "MRP System", MessageBoxButtons.OK); } } else { MessageBox.Show(this, "Packing QC is Not Passed", "Can not Proceed", MessageBoxButtons.OK); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }