private void FillMatrixAuction(List <AuctionsDTO> pLstAuctionDTO) { try { DtMatrixAuctions.Rows.Clear(); int i = 0; this.UIAPIRawForm.Freeze(true); foreach (AuctionsDTO lObjAuction in pLstAuctionDTO) { DtMatrixAuctions.Rows.Add(); DtMatrixAuctions.SetValue("#", i, i + 1); DtMatrixAuctions.SetValue("C_Auction", i, lObjAuction.Folio); DtMatrixAuctions.SetValue("C_TotalB", i, lObjAuction.TotalBuyer); DtMatrixAuctions.SetValue("C_TotalC", i, lObjAuction.TotalCharge == null ? "0" : lObjAuction.TotalCharge); i++; } mtxAuction.Columns.Item("#").DataBind.Bind("DsAuctions", "#"); mtxAuction.Columns.Item("C_Auction").DataBind.Bind("DsAuctions", "C_Auction"); mtxAuction.Columns.Item("C_TotalB").DataBind.Bind("DsAuctions", "C_TotalB"); mtxAuction.Columns.Item("C_TotalC").DataBind.Bind("DsAuctions", "C_TotalC"); mtxAuction.LoadFromDataSource(); mtxAuction.AutoResizeColumns(); } catch (Exception ex) { UIApplication.ShowError("frmPayment (FillMatrixAuction) " + ex.Message); LogService.WriteError("frmPayment (FillMatrixAuction) " + ex.Message); LogService.WriteError(ex); } finally { this.UIAPIRawForm.Freeze(false); } }
private string AttatchFile(string pStrFile) { int lIntAttachement = 0; string lStrAttach = string.Empty; string lStrAttachPath = mObjTransportServiceFactory.GetAttachmentDI().GetAttachPath(); if (!string.IsNullOrEmpty(pStrFile)) { lIntAttachement = mObjTransportServiceFactory.GetAttachmentDI().AttachFile(pStrFile); if (lIntAttachement > 0) { lStrAttach = lStrAttachPath + System.IO.Path.GetFileName(pStrFile); } else { LogUtility.WriteError("[InvoiceDI - AttachDocument] " + DIApplication.Company.GetLastErrorDescription()); UIApplication.ShowError(string.Format("[InvoiceDI - AttachDocument] : {0}", DIApplication.Company.GetLastErrorDescription())); if (System.IO.File.Exists(pStrFile)) { lStrAttach = pStrFile; } else { LogUtility.WriteError("[InvoiceDI - AttachDocument] Archivo \n" + pStrFile + " no encontrado"); UIApplication.ShowError("[InvoiceDI - AttachDocument] Archivo \n" + pStrFile + " no encontrado"); } } } return(lStrAttach); }
public int GetInvMovType() { Recordset lObjRecordset = null; IList <string> lLstStrResult = new List <string>(); try { lObjRecordset = (Recordset)DIApplication.Company.GetBusinessObject(BoObjectTypes.BoRecordset); string lStrQuery = this.GetSQL("GetMovType"); lObjRecordset.DoQuery(lStrQuery); if (lObjRecordset.RecordCount > 0) { return((int)lObjRecordset.Fields.Item(0).Value); } } catch (Exception lObjException) { LogService.WriteError(string.Format("[GetInvMovType]: {0} ", lObjException.Message)); LogService.WriteError(lObjException); UIApplication.ShowError(string.Format("[GetInvMovType]: {0}", lObjException.Message)); throw new DAOException(lObjException.Message, lObjException); } finally { MemoryUtility.ReleaseComObject(lObjRecordset); } return(0); }
/// <summary> /// Loads the available bank accounts in the comoboxes. /// </summary> private void cboAuctions_ComboSelectAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal) { try { if (!string.IsNullOrEmpty(CboAuctions.Value)) { mObjLastAuction = mAuctionDAO.GetAuctionByFolio(CboAuctions.Value); if (mObjLastAuction != null) { LoadSellers(mObjLastAuction.Folio); mEdtFolio.Value = mObjLastAuction.Folio; lObjBtnCC.Item.Enabled = true; } else { UIApplication.ShowError("No hay subastas activas."); } } } catch (Exception ex) { LogUtility.WriteError(string.Format("[CheckGeneration - cboAuctions_ComboSelectAfter] Error: {0}", ex.Message)); UIApplication.ShowMessageBox(ex.Message); //UIApplication.ShowError("frm (LoadMatrix)" + ex.Message); } finally { this.UIAPIRawForm.Freeze(false); } }
//select sum(U_netWeight) as NetWeight from [@UG_PL_TCKD] where U_Folio = '258' public string GetNetWeight(string pStrFolio) { Dictionary <string, string> lLstStrParameters = null; string lStrNetWeight = "0"; SAPbobsCOM.Recordset lObjRecordsetCT = null; try { lObjRecordsetCT = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); string lStrQuery = ("select sum(U_netWeight) as NetWeight from [@UG_PL_TCKD] where U_Folio = '{Folio}'"); lLstStrParameters = new Dictionary <string, string>(); lLstStrParameters.Add("Folio", pStrFolio); lStrQuery = lStrQuery.Inject(lLstStrParameters); lObjRecordsetCT.DoQuery(lStrQuery); if (lObjRecordsetCT.RecordCount > 0) { lStrNetWeight = lObjRecordsetCT.Fields.Item(0).Value.ToString(); } } catch (Exception ex) { LogService.WriteError("[GetNetWeight]: " + ex.Message); LogService.WriteError(ex); UIApplication.ShowError("Error al consultar cantidades pendientes " + ex.Message); } finally { MemoryUtility.ReleaseComObject(lObjRecordsetCT); } return(lStrNetWeight); }
public string GetEmployeName(string pStrEmployeId) { SAPbobsCOM.Recordset lObjRecordset = null; string lStrEmployeName = ""; try { Dictionary <string, string> lLstStrParameters = new Dictionary <string, string>(); lLstStrParameters.Add("EmpId", pStrEmployeId); string lStrQuery = this.GetSQL("GetEmployeeName").Inject(lLstStrParameters); //this.UIAPIRawForm.DataSources.DataTables.Item("RESULT").ExecuteQuery(lStrQuery); lObjRecordset = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); lObjRecordset.DoQuery(lStrQuery); if (lObjRecordset.RecordCount > 0) { lStrEmployeName = lObjRecordset.Fields.Item("EmployeeName").Value.ToString(); } } catch (Exception ex) { UIApplication.ShowError(string.Format("GetEmployeName: {0}", ex.Message)); LogService.WriteError("PurchasesDAO (GetEmployeName): " + ex.Message); LogService.WriteError(ex); } finally { MemoryUtility.ReleaseComObject(lObjRecordset); } return(lStrEmployeName); }
//private bool AddForm(Menus pObjMenus, MenuItem pObjMenuItem, MenuCreationParams pObjCreationPackage) //{ // bool lBolResult = false; // try // { // SAPbouiCOM.Menus lObjMenus = null; // lObjMenus = pObjMenus.Item(6).SubMenus.Item(7).SubMenus.Item(4).SubMenus; // pObjCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING; // pObjCreationPackage.UniqueID = "ReceptionForm"; // pObjCreationPackage.String = "Recepción de Alimento"; // //pObjCreationPackage.Image = ; // pObjCreationPackage.Position = lObjMenus.Count + 1; // lObjMenus.AddEx(pObjCreationPackage); // //Update result // lBolResult = true; // } // catch (Exception ex) // { // UIApplication.ShowError(string.Format("RegisterModuleException: {0}", ex.Message)); // } // return lBolResult; //} private bool AddModule(Module pObjModule, Menus pObjMenus, MenuItem pObjMenuItem, MenuCreationParams pObjCreationPackage) { bool lBolResult = false; try { //Prepare module pObjCreationPackage.Type = BoMenuType.mt_POPUP; pObjCreationPackage.UniqueID = pObjModule.UniqueID; pObjCreationPackage.String = pObjModule.String; pObjCreationPackage.Enabled = pObjModule.Enable; pObjCreationPackage.Image = pObjModule.Image; pObjCreationPackage.Position = pObjModule.Position; pObjMenus = pObjMenuItem.SubMenus; //Add module pObjMenus.AddEx(pObjCreationPackage); //Update result lBolResult = true; } catch (Exception ex) { UIApplication.ShowError(string.Format("RegisterModuleException: {0}", ex.Message)); } return(lBolResult); }
public List <PayLoadTypeDTO> GetPayloadTypeList() { SAPbobsCOM.Recordset lObjResults = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); List <PayLoadTypeDTO> lLstPayloadType = new List <PayLoadTypeDTO>(); try { string lStrQuery = this.GetSQL("PayloadTypes"); lObjResults.DoQuery(lStrQuery); if (lObjResults.RecordCount > 0) { for (int i = 0; i < lObjResults.RecordCount; i++) { lLstPayloadType.Add(new PayLoadTypeDTO() { Name = lObjResults.Fields.Item("Name").Value.ToString(), Code = lObjResults.Fields.Item("Code").Value.ToString(), }); lObjResults.MoveNext(); } } } catch (Exception ex) { UIApplication.ShowError(string.Format("GetPayloadTypeList: {0}", ex.Message)); LogService.WriteError("RouteListDAO (GetPayloadTypeList): " + ex.Message); LogService.WriteError(ex); } finally { MemoryUtility.ReleaseComObject(lObjResults); } return(lLstPayloadType); }
public bool CheckInsuranceItem(string pStrItemCode, int pIntUserSign) { SAPbobsCOM.Recordset lObjResults = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); try { Dictionary <string, string> lLstParams = new Dictionary <string, string>(); lLstParams.Add("WHS", GetWhs(pIntUserSign)); lLstParams.Add("ItemCode", pStrItemCode); string lStrQuery = this.GetSQL("GetInsuranceItem").Inject(lLstParams); lObjResults.DoQuery(lStrQuery); return(lObjResults.RecordCount > 0 ? true : false); } catch (Exception ex) { UIApplication.ShowError(string.Format("CheckInsuranceItem: {0}", ex.Message)); LogService.WriteError("RouteListDAO (CheckInsuranceItem): " + ex.Message); LogService.WriteError(ex); return(false); } finally { MemoryUtility.ReleaseComObject(lObjResults); } }
private void LoadMtxDetail(string pStrDocEntry) { try { string lStrQuery = mObjReceptionTransferDAO.SearchWhsTransitDetail(pStrDocEntry); if (lStrQuery != "") { this.UIAPIRawForm.DataSources.DataTables.Item("DT_Detail").ExecuteQuery(lStrQuery); if (this.UIAPIRawForm.DataSources.DataTables.Item("DT_Detail").IsEmpty) { mtxDetail.Clear(); UIApplication.ShowWarning(string.Format("No se encontró el detalle de la trasferencia {0}", pStrDocEntry)); } else { mtxDetail.Columns.Item("Col_0").DataBind.Bind("DT_Detail", "DocEntry"); mtxDetail.Columns.Item("Col_1").DataBind.Bind("DT_Detail", "ItemCode"); mtxDetail.Columns.Item("Col_2").DataBind.Bind("DT_Detail", "Dscription"); mtxDetail.Columns.Item("Col_3").DataBind.Bind("DT_Detail", "Quantity"); mtxDetail.Columns.Item("Col_4").DataBind.Bind("DT_Detail", "U_GLO_BagsBales"); mtxDetail.Columns.Item("Col_5").DataBind.Bind("DT_Detail", "FromWhsCod"); //'de alamacen' mtxDetail.Columns.Item("Col_6").DataBind.Bind("DT_Detail", "WhsCode"); //'almacen destino' mtxDetail.LoadFromDataSource(); } } } catch (Exception ex) { UIApplication.ShowError(string.Format("ItemEventException: {0}", ex.Message)); } finally { } }
private void SBO_Application_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent) { BubbleEvent = true; try { if (FormUID.Equals(this.UIAPIRawForm.UniqueID)) { if (!pVal.BeforeAction) { switch (pVal.EventType) { case BoEventTypes.et_FORM_CLOSE: UnloadApplicationEvents(); break; case BoEventTypes.et_CLICK: if (pVal.ItemUID == "mtxHeader" && mtxHeader.RowCount > 0 && pVal.Row > 0) { UIAPIRawForm.Freeze(true); mtxHeader.SelectRow(pVal.Row, true, false); mIntId = ((SAPbouiCOM.EditText)mtxHeader.GetCellSpecific(1, pVal.Row)).Value; this.LoadMtxDetail(mIntId); UIAPIRawForm.Freeze(false); } break; } } } } catch (Exception ex) { UIAPIRawForm.Freeze(false); UIApplication.ShowError(string.Format("ItemEventException: {0}", ex.Message)); } }
private void Form_ResizeAfter(SAPbouiCOM.SBOItemEventArg pVal) { try { UIAPIRawForm.Freeze(true); mtxSellers.Item.Height = UIAPIRawForm.Height / 2 - 75; mtxAuction.Item.Top = UIAPIRawForm.Height / 2; mtxAuction.Item.Height = UIAPIRawForm.Height / 2 - 85; lblBuyers.Item.Top = UIAPIRawForm.Height / 2 - 20; btnCreate.Item.Top = UIAPIRawForm.Height - 75; btnCancel.Item.Top = UIAPIRawForm.Height - 75; btnFinish.Item.Top = UIAPIRawForm.Height - 75; mtxAuction.AutoResizeColumns(); mtxSellers.AutoResizeColumns(); } catch (Exception ex) { UIApplication.ShowError("frmPayment (Form_ResizeAfter)" + ex.Message); LogService.WriteError("frmPayment (Form_ResizeAfter)" + ex.Message); LogService.WriteError(ex); } finally { UIAPIRawForm.Freeze(false); } }
private void UpdateJorunalEntryDebit(JournalEntryDTO pObjJournalEntry) { try { string lStrAccountC = DtMatrixSellers.GetValue("C_AccountC", mIntRowSelected - 1).ToString(); string lStrAccountD = DtMatrixSellers.GetValue("C_AccountD", mIntRowSelected - 1).ToString(); JournalEntryDTO lObjJournalEntry = mLstJournalEntryDTO.Where(x => x.Aux == pObjJournalEntry.Aux && x.Account == lStrAccountD).FirstOrDefault(); if (lObjJournalEntry == null) { lObjJournalEntry = new JournalEntryDTO(); lObjJournalEntry.AuctionId = mStrAuctionId; lObjJournalEntry.Area = pObjJournalEntry.Area; lObjJournalEntry.AuxType = pObjJournalEntry.AuxType; lObjJournalEntry.Aux = pObjJournalEntry.Aux; lObjJournalEntry.Debit = pObjJournalEntry.Credit; lObjJournalEntry.Credit = 0; lObjJournalEntry.AuctionId = mStrAuctionId; lObjJournalEntry.Account = lStrAccountD; mLstJournalEntryDTO.Add(lObjJournalEntry); } else { decimal lDecDebit = mLstJournalEntryDTO.Where(x => x.Aux == pObjJournalEntry.Aux && x.Account == lStrAccountC).Sum(y => y.Credit); lObjJournalEntry.Debit = lDecDebit; } } catch (Exception ex) { UIApplication.ShowError("frmPayment (UpdateJorunalEntryDebit) " + ex.Message); LogService.WriteError("frmPayment (UpdateJorunalEntryDebit) " + ex.Message); LogService.WriteError(ex); } }
private void UpdateMatrix() { try { this.UIAPIRawForm.Freeze(true); decimal lDecPaymentPayment = 0; for (int i = 0; i < DtMatrixAuctions.Rows.Count; i++) { string lStrPayment = (mtxAuction.Columns.Item("C_TotalC").Cells.Item(i + 1).Specific as EditText).Value.Trim(); decimal lDblPayment = Convert.ToDecimal(lStrPayment == "" ? "0" : lStrPayment); DtMatrixAuctions.SetValue("C_TotalC", i, lDblPayment.ToString()); lDecPaymentPayment += lDblPayment; } decimal lDecPaymentSell = Convert.ToDecimal(DtMatrixSellers.GetValue("C_TotalS", mIntRowSelected - 1).ToString()); DtMatrixSellers.SetValue("C_TotalC", mIntRowSelected - 1, lDecPaymentPayment.ToString()); DtMatrixSellers.SetValue("C_Total", mIntRowSelected - 1, (lDecPaymentSell - lDecPaymentPayment).ToString()); mtxSellers.LoadFromDataSource(); mtxAuction.LoadFromDataSource(); } catch (Exception ex) { UIApplication.ShowError("frmPayment (UpdateMatrix) " + ex.Message); LogService.WriteError("frmPayment (UpdateMatrix) " + ex.Message); LogService.WriteError(ex); } finally { this.UIAPIRawForm.Freeze(false); } }
public List <string> GetLastAuctions(string pStrCostingCode) { SAPbobsCOM.Recordset lObjRecordset = null; List <string> lLstAuctions = new List <string>(); try { string lStrQuery = this.GetSQL("GetLastsAuctions").InjectSingleValue("CostingCode", pStrCostingCode); lObjRecordset = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); lObjRecordset.DoQuery(lStrQuery); if (lObjRecordset.RecordCount > 0) { for (int i = 0; i < lObjRecordset.RecordCount; i++) { string lStrFolio = lObjRecordset.Fields.Item("U_Folio").Value.ToString(); lLstAuctions.Add(lStrFolio); lObjRecordset.MoveNext(); } } } catch (Exception ex) { UIApplication.ShowError(string.Format("GetActions: {0}", ex.Message)); LogService.WriteError("MailSenderDAO (GetActions): " + ex.Message); LogService.WriteError(ex); } finally { MemoryUtility.ReleaseComObject(lObjRecordset); } return(lLstAuctions); }
public InsuranceDTO GetInsuranceObject(int pIntUserSign) { InsuranceDTO lObjInsurance = new InsuranceDTO(); SAPbobsCOM.Recordset lObjResults = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); try { Dictionary <string, string> lLstParams = new Dictionary <string, string>(); lLstParams.Add("WHS", GetWhs(pIntUserSign)); lLstParams.Add("ItemCode", GetInsuranceItem()); string lStrQuery = this.GetSQL("GetInsuranceItem").Inject(lLstParams); lObjResults.DoQuery(lStrQuery); if (lObjResults.RecordCount > 0) { lObjInsurance.ItemCode = lObjResults.Fields.Item("ItemCode").Value.ToString(); lObjInsurance.Price = float.Parse(lObjResults.Fields.Item("Price").Value.ToString()); } } catch (Exception ex) { UIApplication.ShowError(string.Format("GetInsuranceObject: {0}", ex.Message)); LogService.WriteError("RouteListDAO (GetInsuranceObject): " + ex.Message); LogService.WriteError(ex); return(lObjInsurance); } finally { MemoryUtility.ReleaseComObject(lObjResults); } return(lObjInsurance); }
public string GetCostingCode(string pStrUser) { SAPbobsCOM.Recordset lObjRecordset = null; try { string lStrQuery = this.GetSQL("GetCostingCode").InjectSingleValue("UsrName", pStrUser); lObjRecordset = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); lObjRecordset.DoQuery(lStrQuery); if (lObjRecordset.RecordCount > 0) { return(lObjRecordset.Fields.Item("U_GLO_CostCenter").Value.ToString()); } } catch (Exception ex) { UIApplication.ShowError(string.Format("GetActions: {0}", ex.Message)); LogService.WriteError("MailSenderDAO (GetActions): " + ex.Message); LogService.WriteError(ex); } finally { MemoryUtility.ReleaseComObject(lObjRecordset); } return(string.Empty); }
public int GetFolio(string pStrFolio) { string lStrValue = string.Empty; SAPbobsCOM.Recordset lObjResults = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); try { string lStrQuery = this.GetSQL("GetIntrnlFolio").InjectSingleValue("Folio", pStrFolio); lObjResults.DoQuery(lStrQuery); if (lObjResults.RecordCount > 0) { lStrValue = lObjResults.Fields.Item("Folio").Value.ToString(); } return(!string.IsNullOrEmpty(lStrValue) ? Convert.ToInt32(lStrValue) : 0); } catch (Exception ex) { UIApplication.ShowError(string.Format("GetFolio: {0}", ex.Message)); LogService.WriteError("RouteListDAO (GetFolio): " + ex.Message); LogService.WriteError(ex); return(0); } finally { MemoryUtility.ReleaseComObject(lObjResults); } }
public bool ExistsPayment(string pStrDocEntry) { string lStrStatus = ""; bool lBolResult = false; try { lStrStatus = mObjQueryManager.GetValue("DocStatus", "DocEntry", pStrDocEntry, "OPCH"); if (lStrStatus == "O") { return(false); } else { return(true); } } catch (Exception lObjException) { UIApplication.ShowError(string.Format("CostAccount: {0}", lObjException.Message)); LogService.WriteError("PurchasesDAO (GetDUAccount): " + lObjException.Message); LogService.WriteError(lObjException); } return(lBolResult); }
public float GetTax(string pStrItemCode) { SAPbobsCOM.Recordset lObjRecordSet = null; string lStrQuery = ""; try { lObjRecordSet = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); Dictionary <string, string> lLstParams = new Dictionary <string, string>(); lLstParams.Add("ItemCode", pStrItemCode); lStrQuery = this.GetSQL("GetTax").Inject(lLstParams); lObjRecordSet.DoQuery(lStrQuery); return(float.Parse(lObjRecordSet.Fields.Item("Rate").Value.ToString())); } catch (Exception ex) { UIApplication.ShowError(string.Format("GetJournalId: {0}", ex.Message)); LogService.WriteError("RouteListDAO (GetJournalId): " + ex.Message); LogService.WriteError(ex); return(0); } finally { MemoryUtility.ReleaseComObject(lObjRecordSet); } }
private bool AddSection(Module pObjModule, Section pObjSection, Menus pObjMenus, MenuItem pObjMenuItem, MenuCreationParams pObjCreationPackage) { bool lBolResult = false; try { //Get module menu pObjMenuItem = UIApplication.GetMenus().Item(pObjModule.UniqueID); //Prepare section pObjCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING; pObjCreationPackage.UniqueID = pObjSection.UniqueID; pObjCreationPackage.String = pObjSection.String; pObjMenus = pObjMenuItem.SubMenus; //Add section pObjMenus.AddEx(pObjCreationPackage); //Update result lBolResult = true; } catch (Exception ex) { UIApplication.ShowError(string.Format("RegisterSectionException: {0}", ex.Message)); } return(lBolResult); }
public bool CheckTown(string pStrTown) { SAPbobsCOM.Recordset lObjResults = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); try { Dictionary <string, string> lObjParameters = new Dictionary <string, string>(); lObjParameters.Add("Town", pStrTown); lObjParameters.Add("Search", string.Empty); string lStrQuery = this.GetSQL("GetTowns").Inject(lObjParameters); lObjResults.DoQuery(lStrQuery); return(lObjResults.RecordCount > 0 ? true : false); } catch (Exception ex) { UIApplication.ShowError(string.Format("CheckTown: {0}", ex.Message)); LogService.WriteError("RouteListDAO (CheckTown): " + ex.Message); LogService.WriteError(ex); return(false); } finally { MemoryUtility.ReleaseComObject(lObjResults); } }
public List <string> GetAuthorizers(string pStrConfigName) { SAPbobsCOM.Recordset lObjResults = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); List <string> lStrUsers = new List <string>(); try { Dictionary <string, string> lLstParams = new Dictionary <string, string>(); lLstParams.Add("ConfigName", pStrConfigName); string lStrQuery = this.GetSQL("GetAuthorizers").Inject(lLstParams); lObjResults.DoQuery(lStrQuery); if (lObjResults.RecordCount > 0) { for (int i = 0; i < lObjResults.RecordCount; i++) { lStrUsers.Add(lObjResults.Fields.Item("U_Value").Value.ToString()); lObjResults.MoveNext(); } } } catch (Exception ex) { LogService.WriteError("CommissionDAO (GetAauthorizers): " + ex.Message); LogService.WriteError(ex); UIApplication.ShowError(string.Format("GetAauthorizers: {0}", ex.Message)); } finally { MemoryUtility.ReleaseComObject(lObjResults); } return(lStrUsers); }
private void SBO_Application_ItemEvent(string FormUID, ref ItemEvent pVal, out bool BubbleEvent) { BubbleEvent = true; try { if (FormUID.Equals(this.UIAPIRawForm.UniqueID)) { if (pVal.EventType == BoEventTypes.et_FORM_CLOSE) { UIApplication.GetApplication().ItemEvent -= new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(this.SBO_Application_ItemEvent); } if (!pVal.BeforeAction) { switch (pVal.EventType) { case BoEventTypes.et_CHOOSE_FROM_LIST: ChooseFromListAfterEvent(pVal); break; } } } } catch (Exception ex) { UIApplication.ShowError(string.Format("ItemEventException: {0}", ex.Message)); LogService.WriteError("frmSearchRefunds (SBO_Application_ItemEvent) " + ex.Message); LogService.WriteError(ex); } }
public bool GetLastDelivery(int pIntTicket) { SAPbobsCOM.Recordset lObjRecordsetCT = null; try { lObjRecordsetCT = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); string lStrQuery = (string.Format("SELECT * FROM DLN1 WHERE U_PL_Ticket ='{0}'", pIntTicket)); lObjRecordsetCT.DoQuery(lStrQuery); if (lObjRecordsetCT.RecordCount > 0) { return(true); } } catch (Exception ex) { LogService.WriteError("[RemoveTicketDetail]: " + ex.Message); LogService.WriteError(ex); UIApplication.ShowError("Error: " + ex.Message); } finally { MemoryUtility.ReleaseComObject(lObjRecordsetCT); } return(false); }
private void BindMatrixAuction() { try { this.UIAPIRawForm.Freeze(true); mtxInvoices.Columns.Item("C_#").DataBind.Bind("DT_NC", "#"); mtxInvoices.Columns.Item("C_Client").DataBind.Bind("DT_NC", "C_BP"); mtxInvoices.Columns.Item("C_Cert").DataBind.Bind("DT_NC", "C_Cert"); mtxInvoices.Columns.Item("C_Fact").DataBind.Bind("DT_NC", "C_Inv"); mtxInvoices.Columns.Item("C_HeadsF").DataBind.Bind("DT_NC", "C_HeadInv"); mtxInvoices.Columns.Item("C_HeadsE").DataBind.Bind("DT_NC", "C_HeadExp"); mtxInvoices.Columns.Item("C_HeadsN").DataBind.Bind("DT_NC", "C_HeadNoCr"); mtxInvoices.Columns.Item("C_Import").DataBind.Bind("DT_NC", "C_Amount"); mtxInvoices.LoadFromDataSource(); mtxInvoices.AutoResizeColumns(); } catch (Exception ex) { UIApplication.ShowError("frm (BindDataMatrix) " + ex.Message); LogService.WriteError("frm (BindDataMatrix) " + ex.Message); LogService.WriteError(ex); } finally { this.UIAPIRawForm.Freeze(false); } }
public bool SearchDrafts(string pStrFolio) { Recordset lObjRecordset = null; IList <string> lLstStrResult = new List <string>(); try { lObjRecordset = (Recordset)DIApplication.Company.GetBusinessObject(BoObjectTypes.BoRecordset); string lStrQuery = this.GetSQL("FindDraft").InjectSingleValue("Folio", pStrFolio); lObjRecordset.DoQuery(lStrQuery); if (lObjRecordset.RecordCount > 0) { return(true); } } catch (Exception lObjException) { LogService.WriteError(string.Format("[SearchDrafts]: {0} ", lObjException.Message)); LogService.WriteError(lObjException); UIApplication.ShowError(string.Format("[SearchDrafts]: {0}", lObjException.Message)); throw new DAOException(lObjException.Message, lObjException); } finally { MemoryUtility.ReleaseComObject(lObjRecordset); } return(false); }
//SetValue private void SetDataTableValuesAuction(List <InvoiceExpDTO> pLstAuctionDTO) { try { DtMatrixInvoice = this.UIAPIRawForm.DataSources.DataTables.Item("DT_NC"); DtMatrixInvoice.Rows.Clear(); int i = 0; foreach (InvoiceExpDTO lObjInvoiceExp in pLstAuctionDTO) { DtMatrixInvoice.Rows.Add(); DtMatrixInvoice.SetValue("#", i, i + 1); DtMatrixInvoice.SetValue("C_BP", i, lObjInvoiceExp.BussinesPartner); DtMatrixInvoice.SetValue("C_Cert", i, lObjInvoiceExp.Certificate); DtMatrixInvoice.SetValue("C_Inv", i, lObjInvoiceExp.DocNum); DtMatrixInvoice.SetValue("C_HeadInv", i, lObjInvoiceExp.HeadInvoice); DtMatrixInvoice.SetValue("C_HeadExp", i, lObjInvoiceExp.HeatExport); DtMatrixInvoice.SetValue("C_HeadNoCr", i, lObjInvoiceExp.HeadNoCruz); DtMatrixInvoice.SetValue("C_Amount", i, lObjInvoiceExp.Amount); DtMatrixInvoice.SetValue("C_DocEntry", i, lObjInvoiceExp.DocEntry); DtMatrixInvoice.SetValue("C_Paid", i, lObjInvoiceExp.PaidToDate); i++; } } catch (Exception ex) { UIApplication.ShowError("frm (BindDataMatrix) " + ex.Message); LogService.WriteError("frm (BindDataMatrix) " + ex.Message); LogService.WriteError(ex); } }
public string GetWareHouse(string pStrUserID) { SAPbobsCOM.Recordset lObjRecordset = null; string lStrWareHouse = ""; try { TicketDAO mObjTicketDAO = new TicketDAO(); Dictionary <string, string> lLstStrParameters = new Dictionary <string, string>(); lLstStrParameters.Add("UserID", pStrUserID); string lStrQuery = this.GetSQL("GetWarehouse").Inject(lLstStrParameters); //this.UIAPIRawForm.DataSources.DataTables.Item("RESULT").ExecuteQuery(lStrQuery); lObjRecordset = (SAPbobsCOM.Recordset)DIApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); lObjRecordset.DoQuery(lStrQuery); if (lObjRecordset.RecordCount > 0) { lStrWareHouse = lObjRecordset.Fields.Item(0).Value.ToString(); } } catch (Exception ex) { LogService.WriteError(string.Format("[GetWareHouse]: {0} ", ex.Message)); LogService.WriteError(ex); UIApplication.ShowError(string.Format("[GetWareHouse]: {0}", ex.Message)); // UIApplication.ShowMessageBox(string.Format("InitDataSourcesException: {0}", ex.Message)); } finally { MemoryUtility.ReleaseComObject(lObjRecordset); } return(lStrWareHouse); }
private void btnSeacrh_ClickAfter(object sboObject, SBOItemEventArg pVal) { try { if (mObjPaymentServiceFactory.GetPaymentService().ExistConfiguration("SU_DEUDORA") && mObjPaymentServiceFactory.GetPaymentService().ExistConfiguration("SU_ACREEDORA")) { List <PaymentDTO> lLstPaymentDTO = mObjPaymentServiceFactory.GetPaymentService().GetPayments(txtAuction.Value, mIntSignature).ToList(); if (lLstPaymentDTO.Count() > 0) { mStrAuctionId = txtAuction.Value; LogService.WriteInfo("Carga de subastas correctamente"); } else { UIApplication.ShowWarning("No se encontraron registros para esa subasta"); LogService.WriteInfo("No se encontraron registros para esa subasta"); } FillMatrix(lLstPaymentDTO); } else { UIApplication.ShowMessageBox("Los registros SU_DEUDORA o SU_ACREEDORA no existen en la tabla de configuración"); LogService.WriteInfo("Los registros SU_DEUDORA o SU_ACREEDORA no existen en la tabla de configuración"); } } catch (Exception ex) { UIApplication.ShowError("frmPayment (txtAuction_KeyDownAfter)" + ex.Message); LogService.WriteError("frmPayment (txtAuction_KeyDownAfter)" + ex.Message); LogService.WriteError(ex); } }