public bool CheckCompleteInputData(StockTakingDTO argStockTaking) { bool bCompleteInput = false; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK040_CheckCompleteInputData"; req.Parameters.Add("@pDtm_StockTakingDate", argStockTaking.STOCK_TAKING_DATE); req.Parameters.Add("@pVar_LocationCode", argStockTaking.LOCATION_CODE); req.CommandType = System.Data.CommandType.StoredProcedure; int iReturnCode = (int)db.ExecuteScalar(req); if (iReturnCode == 1) { bCompleteInput = true; } else { bCompleteInput = false; } return(bCompleteInput); }
public bool CheckExistsStockTaking(StockTakingDTO argStockTaking) { bool bExistsStockTaking = false; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK010_CheckExistsStockTaking"; req.Parameters.Add("@pDtm_StockTakingDate", argStockTaking.STOCK_TAKING_DATE); req.CommandType = System.Data.CommandType.StoredProcedure; int iResult = (int)db.ExecuteScalar(req); if (iResult == 1) { bExistsStockTaking = true; } else { bExistsStockTaking = false; } return(bExistsStockTaking); }
private void ExportData() { string strFileName = GenerateFileName("StockTaking"); string strTemplateFileName = @"Report\STR030_StockTaking.xls"; string strTemplatePath = Path.Combine(Application.StartupPath, strTemplateFileName); string strExportPath = SaveDialogUtil.GetBrowseFileDialogForExport(strFileName); if (!"".Equals(strExportPath)) { StockTakingDTO dto = new StockTakingDTO(); dto.STOCK_TAKING_DATE = Convert.ToDateTime(dtStockTakingDate.DateValue); dto.LOCATION_CODE = cboProcess.SelectedValue == null ? string.Empty : cboProcess.SelectedValue.ToString();//txtLocation.Text; dto.PART_NO = txtMasterNo.Text; dto.PART_TYPE = Convert.ToString(cboItemType.SelectedValue); dto.PART_SUB_TYPE = Convert.ToString(cboItemClassMinor04.SelectedValue); if (chkIncomplete.Checked) { dto.SEARCH_INCOMPLETE = 1; } else { dto.SEARCH_INCOMPLETE = 0; } if (chkDiff.Checked) { dto.SEARCH_DIFF = 1; } else { dto.SEARCH_DIFF = 0; } if (chkNoMaster.Checked) { dto.NO_MASTER = 1; } else { dto.NO_MASTER = 0; } DataSet ds = GetExportTable(dto); ExportUtil.Export(ds, strTemplatePath, strExportPath); MessageDialog.ShowInformation(this, null, new EVOFramework.Message(Messages.eInformation.INF9003.ToString()).MessageDescription); if (File.Exists(strExportPath)) { System.Diagnostics.Process.Start(strExportPath); } } }
public bool CheckExistsStockTaking(StockTakingDTO argStockTaking) { bool bExistsStockTaking = false; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); bExistsStockTaking = dao.CheckExistsStockTaking(argStockTaking); return bExistsStockTaking; }
public DataTable LoadStockTakingEntryData(StockTakingDTO argStockTaking) { DataTable ret = null; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); ret = dao.LoadStockTakingEntryData(argStockTaking); return ret; }
public StockTakingDTO LoadLastStockTaking() { StockTakingDTO ret = null; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); ret = dao.LoadLastStockTaking(); return ret; }
public string GetTextEffectInventory(StockTakingDTO argStockTaking) { string strEffectInventory = ""; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); strEffectInventory = dao.GetTextEffectInventory(argStockTaking); return strEffectInventory; }
public int GetFlagRunUpdateProcess(StockTakingDTO argStockTaking) { int ret = 1; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); ret = dao.GetFlagRunUpdateProcess(argStockTaking); return ret; }
private DataSet GetExportTable(StockTakingDTO argSTK) { DataSet ds = null; ReportBIZ biz = new ReportBIZ(); ds = biz.LoadStockCountingResultForExport(argSTK); return(ds); }
public DataSet LoadStockCountingResultForExport(StockTakingDTO argSTK) { DataSet ret = null; ReportDAO dao = new ReportDAO(CommonLib.Common.CurrentDatabase); ret = dao.LoadStockCountingResultForExport(argSTK); return(ret); }
public bool CheckCompleteInputData(StockTakingDTO argStockTaking) { bool bCompleteInput = false; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); bCompleteInput = dao.CheckCompleteInputData(argStockTaking); return bCompleteInput; }
public bool CheckLocationRunUpdateProcess(StockTakingDTO argStockTaking) { bool bRunUpdateProcess = false; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); bRunUpdateProcess = dao.CheckLocationRunUpdateProcess(argStockTaking); return bRunUpdateProcess; }
private void LoadLastStockTaking() { StockTakingBIZ stkBiz = new StockTakingBIZ(); StockTakingDTO stkDTO = stkBiz.LoadLastStockTaking(); if (stkDTO != null) { this.txtLastRemark.Text = stkDTO.REMARK; this.dtpLastSTKDate.DateValue = stkDTO.STOCK_TAKING_DATE; this.txtLastPreProcessBy.Text = stkDTO.PRE_PROCESS_BY + " - " + stkDTO.PRE_PROCESS_NAME; } }
public StockTakingDTO RunStockTakingPreProcess(StockTakingDTO argStockTaking) { StockTakingDTO ret = null; argStockTaking.CRT_BY = CommonLib.Common.CurrentUserInfomation.UserCD; argStockTaking.CRT_MACHINE = CommonLib.Common.CurrentUserInfomation.Machine; argStockTaking.UPD_BY = CommonLib.Common.CurrentUserInfomation.UserCD; argStockTaking.UPD_MACHINE = CommonLib.Common.CurrentUserInfomation.Machine; StockTakingDAO dao = new StockTakingDAO(CommonLib.Common.CurrentDatabase); dao.RunStockTakingPreProcess(argStockTaking); return ret; }
public DataSet LoadStockCountingResult(StockTakingDTO argSTK) { DataSet ret = null; ReportDAO dao = new ReportDAO(CommonLib.Common.CurrentDatabase); ret = dao.LoadStockCountingResult(argSTK); if (ret != null && ret.Tables.Count > 0) { ret.Tables[0].TableName = "S_STR020_StockCountingResult"; } return(ret); }
private ErrorItem CheckCanRunProcess() { try { // modify on 30/oct // fix to support in case run closing period before end of month //// get year month //InventoryPeriodBIZ bizPeriod = new InventoryPeriodBIZ(); //InventoryPeriodDTO dtoPeriod = bizPeriod.LoadCurrentPeriod(); //if (!dtoPeriod.YEAR_MONTH.StrongValue.Equals(Convert.ToDateTime(dtpLastSTKDate.DateValue).ToString("yyyyMM"))) //{ // return new ErrorItem(null, TKPMessages.eValidate.VLM0075.ToString()); //} if (cboProcess.SelectedIndex == -1) { return(new ErrorItem(null, TKPMessages.eValidate.VLM0087.ToString())); } StockTakingBIZ bizStockTaking = new StockTakingBIZ(); StockTakingDTO dtoStockTaking = new StockTakingDTO(); dtoStockTaking.STOCK_TAKING_DATE = Convert.ToDateTime(dtpLastSTKDate.DateValue); dtoStockTaking.LOCATION_CODE = Convert.ToString(this.cboProcess.SelectedValue); bool bRunUpdateProcess = bizStockTaking.CheckLocationRunUpdateProcess(dtoStockTaking); if (bRunUpdateProcess) { return(new ErrorItem(null, TKPMessages.eValidate.VLM0090.ToString(), new object[] { Convert.ToString(this.cboProcess.SelectedValue) })); } bool bCompleteInputData = bizStockTaking.CheckCompleteInputData(dtoStockTaking); if (bCompleteInputData == false) { return(new ErrorItem(null, TKPMessages.eValidate.VLM0091.ToString(), new object[] { Convert.ToString(this.cboProcess.SelectedValue) })); } } catch (Exception ex) { MessageDialog.ShowBusiness(this, ex.Message); } return(null); }
public string GetTextEffectInventory(StockTakingDTO argStockTaking) { string strEffectInventory = ""; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK040_GetTextEffectInventory"; req.Parameters.Add("@pDtm_StockTakingDate", argStockTaking.STOCK_TAKING_DATE); req.Parameters.Add("@pVar_LocationCode", argStockTaking.LOCATION_CODE); req.CommandType = System.Data.CommandType.StoredProcedure; strEffectInventory = (string)db.ExecuteScalar(req); return(strEffectInventory); }
private void LoadCurrentStockTakingData() { StockTakingBIZ stkBiz = new StockTakingBIZ(); StockTakingDTO stkDTO = stkBiz.LoadLastStockTaking(); if (stkDTO != null) { this.txtRemark.Text = stkDTO.REMARK; this.dtStockTakingDate.DateValue = stkDTO.STOCK_TAKING_DATE; this.txtPreProcessBy.Text = stkDTO.PRE_PROCESS_BY + " - " + stkDTO.PRE_PROCESS_NAME; } else { MessageDialog.ShowBusiness(this , new EVOFramework.Message(TKPMessages.eValidate.VLM0086.ToString())); } }
public int GetFlagRunUpdateProcess(StockTakingDTO argStockTaking) { int ret = 1; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK030_GetFlagRunUpdateProcess"; req.Parameters.Add("@pDtm_StockTakingDate", argStockTaking.STOCK_TAKING_DATE); req.Parameters.Add("@pVar_LocationCode", argStockTaking.LOCATION_CODE); req.CommandType = System.Data.CommandType.StoredProcedure; ret = (int)db.ExecuteScalar(req); return(ret); }
public StockTakingDTO RunStockTakingPreProcess(StockTakingDTO argStockTaking) { Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK010_PreProcess"; req.Parameters.Add("@pDtm_StockTakingDate", argStockTaking.STOCK_TAKING_DATE); req.Parameters.Add("@pVar_YearMonth", argStockTaking.YEAR_MONTH); req.Parameters.Add("@pVar_PreProcessBy", argStockTaking.CRT_BY); req.Parameters.Add("@pVar_Remark", argStockTaking.REMARK); req.Parameters.Add("@pVar_Machine", argStockTaking.CRT_MACHINE); req.CommandType = System.Data.CommandType.StoredProcedure; db.ExecuteNonQuery(req); return(argStockTaking); }
private DataSet GetReportTable(StockTakingDTO argSTK) { DataSet ds = null; ReportBIZ biz = new ReportBIZ(); if (rdoReportCountingResult.Checked) { ds = biz.LoadStockCountingResult(argSTK); } else { ds = biz.LoadStockCheckingList(argSTK); } return(ds); }
private void btnRun_Click(object sender, EventArgs e) { try { ErrorItem err = CheckCanRunProcess(); if (err != null) { MessageDialog.ShowBusiness(this, err.Message); return; } StockTakingDTO dtoStockTaking = new StockTakingDTO(); dtoStockTaking.STOCK_TAKING_DATE = Convert.ToDateTime(dtpLastSTKDate.DateValue); dtoStockTaking.YEAR_MONTH = txtYearMonth.Text; dtoStockTaking.LOCATION_CODE = Convert.ToString(cboProcess.SelectedValue); StockTakingBIZ bizStockTaking = new StockTakingBIZ(); string strTextEffectInventory = bizStockTaking.GetTextEffectInventory(dtoStockTaking); MessageDialogResult dr = MessageDialog.ShowConfirmation(this, new Message(SystemMaintenance.Messages.eConfirm.CFM9009.ToString(), new object[] { strTextEffectInventory }).MessageDescription, MessageDialogButtons.YesNo); if (dr == MessageDialogResult.Yes) { if (RunProcess()) { MessageDialog.ShowBusiness(this, Message.LoadMessage(SystemMaintenance.Messages.eInformation.INF9003.ToString())); } this.cboProcess.SelectedIndex = -1; LoadCurrentStockTakingData(); } } catch (ValidateException ex) { MessageDialog.ShowBusiness(this, ex.ErrorResults[0].Message); } catch (BusinessException ex) { MessageDialog.ShowBusiness(this, ex.Error.Message); } catch (Exception ex) { MessageDialog.ShowBusiness(this, ex.Message); } }
private void LoadCurrentStockTakingData() { StockTakingBIZ stkBiz = new StockTakingBIZ(); StockTakingDTO stkDTO = stkBiz.LoadLastStockTaking(); if (stkDTO != null) { this.dtpLastSTKDate.DateValue = stkDTO.STOCK_TAKING_DATE; this.txtLastPreProcessBy.Text = stkDTO.PRE_PROCESS_BY + " - " + stkDTO.PRE_PROCESS_NAME; this.txtYearMonth.Text = stkDTO.YEAR_MONTH; CtrlUtil.EnabledControl(true, btnLocation, btnRun, cboProcess); } else { CtrlUtil.EnabledControl(false, btnLocation, btnRun, cboProcess); MessageDialog.ShowBusiness(this , new EVOFramework.Message(TKPMessages.eValidate.VLM0086.ToString())); } }
private bool RunProcess() { try { StockTakingBIZ biz = new StockTakingBIZ(); StockTakingDTO stk = new StockTakingDTO(); stk.STOCK_TAKING_DATE = Convert.ToDateTime(dtpLastSTKDate.DateValue); stk.YEAR_MONTH = txtYearMonth.Text; stk.LOCATION_CODE = Convert.ToString(cboProcess.SelectedValue); biz.RunStockTakingUpdateProcess(stk); return(true); } catch (Exception ex) { MessageDialog.ShowBusiness(this, ex.Message); } return(false); }
private bool RunProcess() { try { StockTakingBIZ biz = new StockTakingBIZ(); StockTakingDTO stk = new StockTakingDTO(); stk.STOCK_TAKING_DATE = Convert.ToDateTime(dtpStockTakingDate.Value); stk.REMARK = txtRemark.Text; stk.YEAR_MONTH = txtYearMonth.Text; biz.RunStockTakingPreProcess(stk); return(true); } catch (Exception ex) { MessageDialog.ShowBusiness(this, ex.Message); picWaiting.Visible = false; } return(false); }
public DataTable LoadStockTakingEntryData(StockTakingDTO argStockTaking) { DataTable ret = null; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK030_LoadStockTakingEntryData"; req.Parameters.Add("@pDtm_StockTakingDate", argStockTaking.STOCK_TAKING_DATE); req.Parameters.Add("@pVar_LocationCode", argStockTaking.LOCATION_CODE); req.Parameters.Add("@pInt_IncompleteFlag", argStockTaking.SEARCH_INCOMPLETE); req.CommandType = System.Data.CommandType.StoredProcedure; DataSet ds = db.ExecuteDataSet(req); if (ds != null && ds.Tables.Count > 0) { ret = ds.Tables[0]; } return(ret); }
public StockTakingDTO LoadLastStockTaking() { StockTakingDTO ret = null; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK010_LoadLatestStockTaking"; req.CommandType = CommandType.StoredProcedure; db.KeepConnection = true; using (IDataReader reader = db.ExecuteDataReader(req)) { if (reader.Read()) { ret = new StockTakingDTO(); ret.STOCK_TAKING_DATE = reader.GetDateTime(0); ret.YEAR_MONTH = reader.GetString(1); ret.PRE_PROCESS_BY = reader.GetString(2); ret.PRE_PROCESS_DATE = reader.GetDateTime(3); ret.REMARK = reader.GetString(4); ret.CRT_BY = reader.GetString(5); ret.CRT_DATE = reader.GetDateTime(6); ret.CRT_MACHINE = reader.GetString(7); ret.UPD_BY = reader.GetString(8); ret.UPD_DATE = reader.GetDateTime(9); ret.UPD_MACHINE = reader.GetString(10); ret.PRE_PROCESS_NAME = reader.GetString(11); } } db.KeepConnection = false; return(ret); }
public DataSet LoadStockCountingResult(StockTakingDTO argSTK) { DataSet ret = null; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STR020_StockCountingResult"; req.CommandType = CommandType.StoredProcedure; req.Parameters.Add("@pDtm_StockTakingDate", argSTK.STOCK_TAKING_DATE); req.Parameters.Add("@pVar_LocationCode", CheckNull(argSTK.LOCATION_CODE)); req.Parameters.Add("@pVar_PartNo", CheckNull(argSTK.PART_NO)); req.Parameters.Add("@pVar_PartType", CheckNull(argSTK.PART_TYPE)); req.Parameters.Add("@pVar_PartSubType", CheckNull(argSTK.PART_SUB_TYPE)); req.Parameters.Add("@pInt_IncompleteFlag", CheckNull(argSTK.SEARCH_INCOMPLETE)); req.Parameters.Add("@pInt_DiffFlag", CheckNull(argSTK.SEARCH_DIFF)); req.Parameters.Add("@pInt_NoMaster", CheckNull(argSTK.NO_MASTER)); ret = m_db.ExecuteDataSet(req); return(ret); }
public DataTable LoadStockTakingForUpdateProcess(StockTakingDTO argStockTaking) { DataTable ret = null; Database db = m_db; DataRequest req = new DataRequest(); req.CommandText = "S_STK040_LoadStockTakingForUpdateProcess"; req.Parameters.Add("@pDtm_StockTakingDate", argStockTaking.STOCK_TAKING_DATE); req.Parameters.Add("@pVar_LocationCode", argStockTaking.LOCATION_CODE); req.Parameters.Add("@pVar_UpdateBy", argStockTaking.UPD_BY); req.Parameters.Add("@pVar_UpdateMachine", argStockTaking.UPD_MACHINE); req.CommandType = System.Data.CommandType.StoredProcedure; DataSet ds = db.ExecuteDataSet(req); if (ds != null && ds.Tables.Count > 0) { ret = ds.Tables[0]; } return(ret); }
private void LoadCurrentStockTakingData() { InventoryPeriodBIZ biz = new InventoryPeriodBIZ(); InventoryPeriodDTO dto = biz.LoadCurrentPeriod(); //DateTime currentYearMonth = new DateTime( // Convert.ToInt32(dto.YEAR_MONTH.StrongValue.Substring(0, 4)), // Convert.ToInt32(dto.YEAR_MONTH.StrongValue.Substring(4, 2)), // 1); txtYearMonth.Text = dto.YEAR_MONTH; dtpStockTakingDate.Value = DateTime.Today; StockTakingBIZ stkBiz = new StockTakingBIZ(); StockTakingDTO stkDTO = stkBiz.LoadLastStockTaking(); if (stkDTO != null) { this.txtLastRemark.Text = stkDTO.REMARK; this.dtpLastSTKDate.DateValue = stkDTO.STOCK_TAKING_DATE; this.txtLastPreProcessBy.Text = stkDTO.PRE_PROCESS_BY + " - " + stkDTO.PRE_PROCESS_NAME; } //CommonLib.CtrlUtil.EnabledControl(false, txtInfo, dtInventoryMonth); }