private void button1_Click(object sender, EventArgs e) { //criar um formulário com dois matrix this.oForm = UIHelper.CriarForm(this.oApplication, SAPbouiCOM.BoFormBorderStyle.fbs_Sizable, "TypeFrmMatrix", "UidFrmGrid", 200, 600, true, 0, "Matrix e Celulas", 250, 740, 44, 366); this.oButtonOK = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 5, 65, 170, 19, "Ok", false); this.oButtonCancel = UIHelper.AddBotaoAoFormulario(this.oForm, "2", 75, 65, 170, 19, "Cancel", false); AddDataSources(); this.oMatrix1 = UIHelper.AddMatrixAoFormulario(this.oForm, "Matrix1", 360, 361, 5, 150, SAPbouiCOM.BoMatrixSelect.ms_Auto); this.AddColunasMatrix1(this.oMatrix1); this.setMatrix(ref this.oMatrix1); this.oMatrix2 = UIHelper.AddMatrixAoFormulario(this.oForm, "Matrix2", 5, 361, 5, 150, SAPbouiCOM.BoMatrixSelect.ms_Auto); this.AddColunasMatrix1(this.oMatrix2); this.setMatrix(ref this.oMatrix2); this.oForm.Settings.Enabled = true; this.oForm.Visible = true; this.btnMudarGrid.Enabled = true; this.btnMatrix.Enabled = false; }
public frmPeriodoContabilAtual() { AppHelper.SetApplication(ref this.oApplication); this.oForm = UIHelper.CriarForm(this.oApplication, SAPbouiCOM.BoFormBorderStyle.fbs_Sizable, "InfoPer", "Infoper", 0, 0, true, 0, "Periodo Contabil Atual", 70, 150, 0, 0); this.oEditInformacoes = UIHelper.AddEditTextAoFormulario(this.oForm, "EditInfo", 10, 100, 10, 0, "", false, 0, 0); this.oButtonOK = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 10, 65, 25, 19, "Ok", false); this.oEditInformacoes.Value = oApplication.Company.CurrentPeriod.ToString(); this.oForm.Visible = true; }
public void CreateModalForm() { this.oForm = UIHelper.CriarForm(this.oApplication, SAPbouiCOM.BoFormBorderStyle.fbs_Fixed, "Modal1", "Modal1", 170, 150, true, 0, "Formulário Modal"); this.oButtonOK = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 10, 0, 100, 0, "Ok", false); this.oStaticTextMeuStatic = UIHelper.AddStaticTextAoFormulario(this.oForm, "st01", 0, 160, 0, 0, "Eu sou um Fomrulário Modal!!"); this.oForm.Visible = true; this.bModal = true; }
private void CriarFormulario() { SAPbouiCOM.Item oItem = null; //SAPbouiCOM.Button oButton = null; SAPbouiCOM.StaticText oStaticText = null; SAPbouiCOM.ComboBox oComboBox = null; SAPbouiCOM.EditText oEditText = null; try { this.oForm = this.oApplication.Forms.Add("frmStatusBar", BoFormTypes.ft_Fixed, -1); } catch (COMException ex) { //if (ex.ErrorCode == -7010) //{ // this.oForm = this.oApplication.Forms.Add("frmStatusBar"); //} //else //{ System.Windows.Forms.MessageBox.Show( ex.Message , "Erro" , System.Windows.Forms.MessageBoxButtons.OK , System.Windows.Forms.MessageBoxIcon.Error ); System.Environment.Exit(0); //} } ConfiguraForm( "Exemplo Status Bar" , 400 , 350 , 100 , 80 ); //add botao ok this.oButtonOK = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 6, 65, 53, 19, "OK"); this.oButtonMenssagem = UIHelper.AddBotaoAoFormulario(this.oForm, "BTN_STATUS", 90, 150, 53, 19, "Mostrar Mensagem"); this.oItemRect = UIHelper.AddRectAoFormulario(this.oForm, "Rect1", 0, 344, 1, 45); this.oComboBoxTypeMessage = UIHelper.AddComboBoxAoFormulario(this.oForm, "ComboBox1", 157, 163, 24, 14); this.oEditTextMessage = UIHelper.AddEditTextAoFormulario(this.oForm, "edtMessage", 157, 163, 8, 14); this.oStaticTextMensagem = UIHelper.AddStaticTextAoFormulario(this.oForm, "st01", 7, 148, 8, 14, "Mensagem de texto:", "edtMessage"); this.oStaticTextTipoMensagem = UIHelper.AddStaticTextAoFormulario(this.oForm, "st02", 7, 148, 8, 14, "Mensagem de texto:", "ComboBox1"); this.AddDataSources(); this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Warning), "Warning"); this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Error), "Error"); this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_None), "None"); this.oComboBoxTypeMessage.ValidValues.Add(Convert.ToString(BoStatusBarMessageType.smt_Success), "Sucess"); this.oComboBoxTypeMessage.Select(0, BoSearchKey.psk_Index); }
public MeuFormGrid() { AppHelper.SetApplication(ref this.oApplication); this.oForm = UIHelper.CriarForm(this.oApplication, SAPbouiCOM.BoFormBorderStyle.fbs_Sizable, "SAMPLE", "frmGrid", 0, 0, true, 0, "Exemplo de Grid UIAPI", 305, 650); this.oForm.Freeze(true); this.oStaticHeader = UIHelper.AddStaticTextAoFormulario(this.oForm, "StatHeader" , 20, 500, 20, 0, "Em um novo grid você pode definir que os dados sejam agrupados e tenham uma árvore de colapso "); this.oStaticHead = UIHelper.AddStaticTextAoFormulario(this.oForm, "StatHead" , 20, 500, 40, 0, "Neste grid você poderá ver todas as notas fiscias de venda Cadastradas"); this.oBtnCo = UIHelper.AddBotaoAoFormulario(this.oForm, "btnCol", 480, 0, 80, 0, "Collapse", false); this.oBtnExp = UIHelper.AddBotaoAoFormulario(this.oForm, "btnExp", 480, 0, 110, 0, "Expand", false); this.oStaticGroup = UIHelper.AddStaticTextAoFormulario(this.oForm, "StatGroup" , 470, 80, 140, 0, "Agrupado "); userDS = UserDataSourceHelper.AddUserDataSource(this.oForm, "OpBtnDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); this.oOptNoGroup = UIHelper.AddOptionButtonAoFormulario( this.oForm , "optNo" , 480 , 120 , 160 , 0 , "Sem Agrupamento" , "" , true , 0 , 0 ); this.oOptNoGroup.DataBind.SetBound(true, "", "OpBtnDS"); this.oOptCardCode = UIHelper.AddOptionButtonAoFormulario( this.oForm , "optCode" , 480 , 120 , 180 , 0 , "Código do Cliente" , "optNo" , true , 0 , 0 ); this.oOptCardCode.DataBind.SetBound(true, "", "OpBtnDS"); this.oOptDocDate = UIHelper.AddOptionButtonAoFormulario( this.oForm , "optDate" , 480 , 120 , 200 , 0 , " Data do Documento" , "optNo" , true , 0 , 0 ); this.oOptDocDate.DataBind.SetBound(true, "", "OpBtnDS"); this.oOptDocStatus = UIHelper.AddOptionButtonAoFormulario( this.oForm , "optStatus" , 480 , 120 , 220 , 0 , " Status do Documento" , "optNo" , true , 0 , 0 ); this.oOptDocStatus.DataBind.SetBound(true, "", "OpBtnDS"); oItem = oForm.Items.Add("MyGrid", SAPbouiCOM.BoFormItemTypes.it_GRID); oItem.Left = 20; oItem.Top = 60; oItem.Width = 430; oItem.Height = 200; oGrid = ((SAPbouiCOM.Grid)(oItem.Specific)); oForm.DataSources.DataTables.Add("MyDataTable"); oForm.DataSources.DataTables.Item(0).ExecuteQuery("select CardCode, DocDate, DocNum, DocTotal, DocStatus from OINV"); oGrid.DataTable = oForm.DataSources.DataTables.Item("MyDataTable"); oGrid.Columns.Item(0).Width = 50; oGrid.Columns.Item(1).Width = 60; oGrid.Columns.Item(2).Width = 130; for (int i = 0; i < oGrid.Columns.Count; i++) { oGrid.Columns.Item(1).Editable = false; } AtualizarTiposColunas(); ColorirLinhas(); this.oForm.Visible = true; this.oApplication.ItemEvent += OApplication_ItemEvent; this.oForm.Freeze(false); }