public TabOrder() { AppHelper.SetApplication(ref this.oApplication); string strTmp = "TabOrder.srf"; UIHelper.LoadFromXML(oApplication, ref strTmp); oForm = oApplication.Forms.Item("frmTab"); userDS = UserDataSourceHelper.AddUserDataSource(oForm, "OpBtnDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); oItem = oForm.Items.Item("optHor"); oOptionBtnHor = ((SAPbouiCOM.OptionBtn)(oItem.Specific)); oOptionBtnHor.GroupWith("optVer"); oOptionBtnHor.DataBind.SetBound(true, "", "OpBtnDS"); oItem = oForm.Items.Item("optVer"); oOptionBtnVer = ((SAPbouiCOM.OptionBtn)(oItem.Specific)); oOptionBtnVer.GroupWith("optHor"); oOptionBtnVer.DataBind.SetBound(true, "", "OpBtnDS"); oOptionBtnHor.Selected = true; SetTabHorizontal(); oForm.Visible = true; oApplication.ItemEvent += OApplication_ItemEvent; }
private void OnCustomInitialize() { this.oApp = (SAPbouiCOM.Application)SAPbouiCOM.Framework.Application.SBO_Application; this.oCompany = (SAPbobsCOM.Company)oApp.Company.GetDICompany(); //Create Connection SQL SAPbobsCOM.Recordset oR_RecordSet = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); oR_RecordSet.DoQuery("Select * from [@ADDONCFG]"); if (oR_RecordSet.RecordCount > 0) { string uid = oR_RecordSet.Fields.Item("Code").Value.ToString(); string pwd = oR_RecordSet.Fields.Item("Name").Value.ToString(); conn = new SqlConnection(string.Format("Data Source={0}; Initial Catalog={1}; User id={2}; Password={3};", oCompany.Server, oCompany.CompanyDB, uid, pwd)); } else { oApp.MessageBox("Can't connect DB !"); } OptionBtn1.GroupWith("op_cur"); OptionBtn2.GroupWith("op_cur"); OptionBtn3.GroupWith("op_cur"); OptionBtn0.Selected = true; }