public void Refresh_FileManager() { if (_po_id >= 0) { if (_USE_DM) { _ucFileManager.ReadOnly = true; _ucFileManager.DocumentFileLink = GetFileLinks(_po_id); } else { string sSQL = @"select WF_ApprovalPoint_ID from WF_Route where WF_Route_ID =" + _WF_Route_ID; object oWF_ApprovalPoint_ID = Connection.SQLExecutor.ExecuteScalar(sSQL, Connection.TRConnection); if (oWF_ApprovalPoint_ID == null || oWF_ApprovalPoint_ID == DBNull.Value) { oWF_ApprovalPoint_ID = 7; } if (Convert.ToInt32(oWF_ApprovalPoint_ID) == 6) { CFS_FileMgr.RefreshFileList(RelTypePurRec, _po_id, false); } else { CFS_FileMgr.RefreshFileList(RelTypePO, _po_id, false); } } } }
private void ClearScreenControls() { if (_USE_DM) { _ucFileManager.ReferenceID = -1; _ucFileManager.RefreshFileList(); _ucFileManager.ReadOnly = true; } else { CFS_FileMgr.RefreshFileList(RelType, -1, true); } }
public override void LoadAlert(int AlertID, string Subject, string Module, DateTime Received, string Notes, int DetailID) { base.LoadAlert(AlertID, Subject, Module, Received, Notes, DetailID); if (CFS_FileMgr != null) { CFS_FileMgr.RefreshFileList(RelTypePO, DetailID, true); } }
public void Refresh_FileManager(int ws_pcpo_id) { if (ws_pcpo_id >= 0) { if (isPOHeaderRetrieved()) { if (_USE_DM) { _ucFileManager.ReadOnly = true; _ucFileManager.DocumentFileLink = GetFileLinks(ws_pcpo_id); } else { CFS_FileMgr.RefreshFileList(RelType, ws_pcpo_id, true); } } } }
private void LoadHeader(int DetailID) { ClearFields(); string sSelect = @"select w.INV_DATE, w.DUE_DATE, w.SUPPLIER, w.SUPP_NAME, w.CON_INV_NO, g.GST_DESC, s.DESCRIPTION, w.INV_AMOUNT, w.PURCH_AMT, w.GST_AMT, p.PO, w.WHSE_ID, w.REFERENCE, w.COMMENT, isnull(w.pri_id,-1) [PriID], w.GST_CODE, isnull((select isnull(sum(isnull(pd.EXTENSION,0)),0) from po_detail pd where pd.po_id=w.po_id),0) [PO_AMT], t.DESCRIPTION [TERMS], st.Description [SUPPLYTYPE], '('+CAST(ph.pri_code as varchar(15))+') - '+ph.pri_name [Project], isnull(w.Submitted,0) [Submitted], isnull(w.Approved,0) [Approved], isnull(w.PaidToDate,0) [PaidToDate], isnull(w.Remaining,0) [Remaining] from WS_INV_HEADER w left outer join GST_CODES g on w.GST_CODE=g.GST_CODE left outer join SALES_TAXES s on w.SALES_TAX_ID=s.SALES_TAX_ID left outer join PO_HEADER p on w.PO_ID=p.PO_ID left outer join TERMS t on t.TERMS_ID=p.TERMS_ID left outer join PO_SupplyType st on st.PO_SupplyType_ID=p.PO_SupplyType_ID left outer join PROJ_HEADER ph on ph.pri_id=w.pri_id where w.WS_INV_ID = " + DetailID; DataTable dt = Connection.SQLExecutor.ExecuteDataAdapter(sSelect, Connection.TRConnection); if (dt != null) { if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; if (dr != null) { lueGST.EditValue = dr["GST_CODE"]; deInvDate.EditValue = dr["INV_DATE"]; deDueDate.EditValue = dr["DUE_DATE"]; txtSupp.EditValue = dr["SUPPLIER"]; txtName.EditValue = dr["SUPP_NAME"]; txtInvNo.EditValue = dr["CON_INV_NO"]; txtGST.EditValue = dr["GST_DESC"]; txtPST.EditValue = dr["DESCRIPTION"]; txtInvAmt.EditValue = dr["INV_AMOUNT"]; txtPurAmt.EditValue = dr["PURCH_AMT"]; txtGSTAmt.EditValue = dr["GST_AMT"]; txtPO.EditValue = dr["PO"]; lueWHSE.EditValue = dr["WHSE_ID"]; txtReference.EditValue = dr["REFERENCE"]; memoComment.EditValue = dr["COMMENT"]; txtPOAmt.EditValue = dr["PO_AMT"]; object oPriID = dr["PriID"]; sSelect = "select pri_holdback_date from proj_header where pri_id=" + oPriID; deHoldbackDate.EditValue = Connection.SQLExecutor.ExecuteScalar(sSelect, Connection.TRConnection); txtTerms.EditValue = dr["TERMS"]; txtPOSupplyType.EditValue = dr["SUPPLYTYPE"]; txtProject.EditValue = dr["Project"]; txtSubmitted.EditValue = Convert.ToDouble(dr["Submitted"]) + Convert.ToDouble(dr["PURCH_AMT"]); txtApproved.EditValue = dr["Approved"]; txtPaidToDate.EditValue = dr["PaidToDate"]; double dRemaining = Convert.ToDouble(dr["Remaining"]) - Convert.ToDouble(dr["PURCH_AMT"]); txtRemaining.EditValue = dRemaining; object oPurchAmt = dr["PURCH_AMT"]; if (oPurchAmt == null || oPurchAmt == DBNull.Value) { oPurchAmt = 0; } double dPurchAmt = Convert.ToDouble(oPurchAmt); object oPO_AMT = dr["PO_AMT"]; if (oPO_AMT == null || oPO_AMT == DBNull.Value) { oPO_AMT = 0; } double dPO_AMT = Convert.ToDouble(oPO_AMT); if (dRemaining < 0) { txtPaymentStatus.EditValue = "OVER PAYMENT"; this.txtPaymentStatus.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); txtPaymentStatus.ForeColor = Color.Red; } else if (dRemaining > 0) { txtPaymentStatus.EditValue = "UNDER PAYMENT"; this.txtPaymentStatus.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular); txtPaymentStatus.ForeColor = Color.Black; } else { txtPaymentStatus.EditValue = "COMPLETE PAYMENT"; this.txtPaymentStatus.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular); txtPaymentStatus.ForeColor = Color.Black; } } } } sSelect = "select SUM(ISNULL(hold_amt,0)) from WS_INV_DET where WS_INV_ID=" + DetailID; txtHoldbackAmt.EditValue = Connection.SQLExecutor.ExecuteScalar(sSelect, Connection.TRConnection); if (_USE_DM) { FileLinks[0] = new DM_CentralizedFSManager.FileLink("WS_INV_HEADER.WS_INV_ID", _DetailID, Connection.CompanyID, DM_CentralizedFSManager.FileLink.Database.TR, 0, true); FileMgr.DocumentFileLink = FileLinks; } else { CFS_FileMgr.RefreshFileList(RelType, _DetailID, true); } RefreshSubmissionDetails(_DetailID); RefreshChatThread(_DetailID); }