//Combo box filial private void cmbFilial_ComboSelectAfter(object sboObject, SBOItemEventArg pVal) { UIAPIRawForm.Freeze(true); var documento = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_OLCN"); var recordset = (Recordset)CommonController.Company.GetBusinessObject(BoObjectTypes.BoRecordset); var query = @"SELECT VatRegNum from ORCT WHERE BPLId = {0}"; recordset.DoQuery(String.Format(query, documento.GetValue("U_BPLId", 0))); documento.SetValue("U_BPLName", documento.Offset, recordset.Fields.Item("VatRegNum").Value.ToString()); UIAPIRawForm.Freeze(false); }
private void btnCreate_ClickAfter(object sboObject, SBOItemEventArg pVal) { try { IList <string> lLstStrCreateJounalEntry = mObjPaymentServiceFactory.CreateDocument().CreateDocument(mLstJournalEntryDTO); if (lLstStrCreateJounalEntry.Count() == 0) { UIApplication.ShowMessageBox("Guardado correcto"); UIApplication.ShowSuccess("Creación de asiento realizado correctamente"); LogService.WriteSuccess("Creación de asiento realizado correctamente"); try { UIAPIRawForm.Freeze(true); DtMatrixAuctions.Rows.Clear(); List <PaymentDTO> lLstPaymentDTO = mObjPaymentServiceFactory.GetPaymentService().GetPayments(mStrAuctionId, mIntSignature).ToList(); FillMatrix(lLstPaymentDTO); mtxAuction.LoadFromDataSource(); mLstJournalEntryDTO = new List <JournalEntryDTO>(); } catch (Exception ex) { UIApplication.ShowError("frmPayment (btnCreate_ClickAfter) " + ex.Message); LogService.WriteError("frmPayment (btnCreate_ClickAfter) " + ex.Message); LogService.WriteError(ex); } finally { UIAPIRawForm.Freeze(false); } } else { string lStrMessage = string.Format(" \n{0}", string.Join("\n", lLstStrCreateJounalEntry.Select(x => string.Format("{0}", x)).ToArray())); UIApplication.ShowMessageBox("Error al crear el asiento: " + lStrMessage); } } catch (Exception ex) { UIApplication.ShowError("frmPayment (btnCreate_ClickAfter) " + ex.Message); LogService.WriteError("frmPayment (btnCreate_ClickAfter) " + ex.Message); LogService.WriteError(ex); } }
public override void OnInitializeComponent() { UIAPIRawForm.Freeze(true); this.mtxHeader = ((SAPbouiCOM.Matrix)(this.GetItem("mtxHeader").Specific)); this.mtxDetail = ((SAPbouiCOM.Matrix)(this.GetItem("mtxDetail").Specific)); this.cmdAccept = ((SAPbouiCOM.Button)(this.GetItem("cmdAccept").Specific)); this.cmdAccept.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.cmdAccept_ClickBefore); this.cmdReturn = ((SAPbouiCOM.Button)(this.GetItem("cmdReturn").Specific)); this.cmdReturn.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.cmdReturn_ClickBefore); this.lblComents = ((SAPbouiCOM.StaticText)(this.GetItem("lblComents").Specific)); this.txtComents = ((SAPbouiCOM.EditText)(this.GetItem("txtComents").Specific)); this.btnCancel = ((SAPbouiCOM.Button)(this.GetItem("btnCancel").Specific)); this.btnCancel.ClickBefore += new SAPbouiCOM._IButtonEvents_ClickBeforeEventHandler(this.btnCancel_ClickBefore); this.LoadApplicationEvents(); this.OnCustomInitialize(); UIAPIRawForm.Freeze(false); }
//Campo desmarcar todos; private void Button0_PressedAfter(object sboObject, SBOItemEventArg pVal) { UIAPIRawForm.Freeze(true); var recordset = (Recordset)CommonController.Company.GetBusinessObject(BoObjectTypes.BoRecordset); var dados = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_ONGN"); var dtMatriz = UIAPIRawForm.DataSources.DataTables.Item("dtMatriz"); for (int i = 0; i < dtMatriz.Rows.Count; i++) { dtMatriz.SetValue("Select", i, "N"); } LinhaTable = new List <Linha>(); CleanField(); Matrix0.LoadFromDataSourceEx(); UIAPIRawForm.Freeze(false); }
private void GetBoletosEmAberto() { UIAPIRawForm.Freeze(true); var dados = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_ONGN"); var linha = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_NGN1"); var dtMatriz = UIAPIRawForm.DataSources.DataTables.Item("dtMatriz"); dtMatriz.Rows.Clear(); //Aparecer os titulos em aberto por padrão var recordset = (Recordset)CommonController.Company.GetBusinessObject(BoObjectTypes.BoRecordset); var query = @"select distinct ORCT.BPLName, ORCT.VATRegNum, DocNum, OBOE.BoeNum, OBOE.BoeSum, DocDueDate, DocDate, datediff(day, DocDueDate, getDate()) as Date from ORCT inner join OBOE ON OBOE.BoeKey = ORCT.DocEntry where Canceled = 'N' and ORCT.BPLId = {0} and ORCT.CardCode = '{1}' and ORCT.DocDate <= '{2}'"; recordset.DoQuery(String.Format(query, dados.GetValue("U_Filial", dados.Offset).ToString(), dados.GetValue("U_CardCode", dados.Offset).ToString(), dados.GetValue("U_DocDate", dados.Offset).ToString())); dtMatriz.Rows.Add(recordset.RecordCount); var i = 0; while (!recordset.EoF) { dtMatriz.SetValue("NConta", i, recordset.Fields.Item("DocNum").Value.ToString()); dtMatriz.SetValue("NBoleto", i, recordset.Fields.Item("BoeNum").Value.ToString()); dtMatriz.SetValue("ValorTitulo", i, ((double)recordset.Fields.Item("BoeSum").Value).ToString(CultureInfo.InvariantCulture)); dtMatriz.SetValue("Vencimento", i, DateTime.Parse(recordset.Fields.Item("DocDueDate").Value.ToString()).ToString("yyyyMMdd")); dtMatriz.SetValue("Lancamento", i, DateTime.Parse(recordset.Fields.Item("DocDate").Value.ToString()).ToString("yyyyMMdd")); dtMatriz.SetValue("Atraso", i, recordset.Fields.Item("Date").Value.ToString()); recordset.MoveNext(); i++; } UIAPIRawForm.Freeze(false); Matrix0.LoadFromDataSourceEx(); }
private void Form_ResizeAfter(SBOItemEventArg pVal) { try { if (resize) { UIAPIRawForm.Freeze(true); mtx0.Item.Height = UIAPIRawForm.Height / 2 - 100; mtx1.Item.Top = UIAPIRawForm.Height / 2 - 50; mtx1.Item.Height = mtx0.Item.Height; UIAPIRawForm.Freeze(false); } else { resize = true; } } catch (Exception ex) { SAPException.Handle(ex, "Form_ResizeAfter"); } }
private void ComboBox0_ComboSelectAfter(object sboObject, SBOItemEventArg pVal) { UIAPIRawForm.Freeze(true); var dados = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_ONGN"); var linha = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_NGN1"); var recordset = (Recordset)CommonController.Company.GetBusinessObject(BoObjectTypes.BoRecordset); var dtMatriz = UIAPIRawForm.DataSources.DataTables.Item("dtMatriz"); var query = @"SELECT TaxIdNum from OBPL WHERE BPLId = {0}"; recordset.DoQuery(String.Format(query, dados.GetValue("U_Filial", 0))); dados.SetValue("U_Cnpj", dados.Offset, recordset.Fields.Item("TaxIdNum").Value.ToString()); CleanField(); dtMatriz.Rows.Clear(); GetBoletosEmAberto(); UIAPIRawForm.Freeze(false); }
//Valor total private void mtItens_ValidateAfter(object sboObject, SBOItemEventArg pVal) { if (pVal.ColUID != "mtValor") { return; } if (!pVal.ItemChanged) { return; } UIAPIRawForm.Freeze(true); var olcn = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_OLCN"); var lcn1 = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_LCN1"); mtItens.FlushToDataSource(); SumValues(); mtItens.LoadFromDataSourceEx(); UIAPIRawForm.Freeze(false); }
//Btn OK private void Button3_PressedBefore(object sboObject, SBOItemEventArg pVal, out bool BubbleEvent) { BubbleEvent = true; UIAPIRawForm.Freeze(true); if (UIAPIRawForm.Mode != BoFormMode.fm_ADD_MODE && UIAPIRawForm.Mode != BoFormMode.fm_UPDATE_MODE) { return; } var olcn = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_OLCN"); var documento = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_OLCN"); var recordset = (Recordset)CommonController.Company.GetBusinessObject(BoObjectTypes.BoRecordset); var grid = UIAPIRawForm.DataSources.DBDataSources.Item("@HTT_LCN1"); grid.RemoveRecord(grid.Size - 1); mtItens.FlushToDataSource(); if (Double.Parse(etVenc.Value) < Double.Parse(etLanc.Value)) { BubbleEvent = false; SAPbouiCOM.Framework.Application.SBO_Application.StatusBar.SetText("Data de vencimento/lançamento inválida. ", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); return; } for (int i = 0; i < grid.Size - 1; i++) { if (Double.Parse(grid.GetValue("U_ItemVlr", i)) <= 0.0) { SAPbouiCOM.Framework.Application.SBO_Application.StatusBar.SetText("Não é permitido campos em brancos!", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); BubbleEvent = false; } } UIAPIRawForm.Freeze(false); }