public static SAPbouiCOM.CheckBox AddCheckBoxAoFormulario( SAPbouiCOM.Form pForm , string pUID , int pLeft , int pWidth , int pTop , int pHeight , string pCaption , bool AffectsFormMode = false , int pFromPane = 0 , int pToPane = 0 ) { SAPbouiCOM.CheckBox oCheckBox = null; SAPbouiCOM.Item oItem = null; oItem = pForm.Items.Add(pUID, SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX); if (pLeft > 0) { oItem.Left = pLeft; } if (pWidth > 0) { oItem.Width = pWidth; } if (pTop > 0) { oItem.Top = pTop; } if (pHeight > 0) { oItem.Height = pHeight; } oItem.AffectsFormMode = AffectsFormMode; if (pFromPane > 0) { oItem.FromPane = pFromPane; } if (pToPane > 0) { oItem.ToPane = pToPane; } oCheckBox = ((SAPbouiCOM.CheckBox)(oItem.Specific)); oCheckBox.Caption = pCaption; return(oCheckBox); }
public void LlenarChkForms(string oForm) { if (oForm == "BOPC") { SAPbouiCOM.Form oFormBOPC = null; oFormBOPC = sboapp.Forms.Item("BOPC"); //oForm = sboapp.Forms.ActiveForm; SAPbouiCOM.CheckBox chk01 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_ProySN").Specific; SAPbouiCOM.CheckBox chk02 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim1SN").Specific; SAPbouiCOM.CheckBox chk03 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim2SN").Specific; SAPbouiCOM.CheckBox chk04 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim3SN").Specific; SAPbouiCOM.CheckBox chk05 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim4SN").Specific; SAPbouiCOM.CheckBox chk06 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim5SN").Specific; EditText txt01 = (EditText)oFormBOPC.Items.Item("BO_Proy").Specific; EditText txt02 = (EditText)oFormBOPC.Items.Item("BO_Dim1").Specific; EditText txt03 = (EditText)oFormBOPC.Items.Item("BO_Dim2").Specific; EditText txt04 = (EditText)oFormBOPC.Items.Item("BO_Dim3").Specific; EditText txt05 = (EditText)oFormBOPC.Items.Item("BO_Dim4").Specific; EditText txt06 = (EditText)oFormBOPC.Items.Item("BO_Dim5").Specific; //ComboBox cbx01 = (ComboBox)oFormBOPC.Items.Item("BO_Activo").Specific; //ComboBox cbx02 = (ComboBox)oFormBOPC.Items.Item("BO_Status").Specific; //cbx01.Select("Y"); //cbx02.Select("B"); chk01.Checked = false; chk02.Checked = false; chk03.Checked = false; chk04.Checked = false; chk05.Checked = false; chk06.Checked = false; txt01.Item.Enabled = false; txt02.Item.Enabled = false; txt03.Item.Enabled = false; txt04.Item.Enabled = false; txt05.Item.Enabled = false; txt06.Item.Enabled = false; } }
private void InitiallizeForm() { // dtHead = oForm.DataSources.DataTables.Item("dtHead"); // dtHead.Rows.Add(1); dtPendingJEs.Columns.Add("DocDate"); dtPendingJEs.Columns.Add("DocNum"); dtPendingJEs.Columns.Add("DocTotal"); dtPendingJEs.Columns.Add("Originator"); oForm.Freeze(true); mtJE = oForm.Items.Item("mtJE").Specific; mtDet = oForm.Items.Item("mtDet").Specific; dtDet = oForm.DataSources.DataTables.Item("dtDet"); dtHead = oForm.DataSources.DataTables.Item("dtHead"); cbOr = oForm.Items.Item("cbOr").Specific; IcbOr = oForm.Items.Item("cbOr"); cbOr.ValidValues.Add("All", "All"); fillUserCb(); oForm.DataSources.UserDataSources.Add("txDN", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month txDN = oForm.Items.Item("txDN").Specific; ItxDN = oForm.Items.Item("txDN"); txDN.DataBind.SetBound(true, "", "txDN"); oForm.DataSources.UserDataSources.Add("txDD", SAPbouiCOM.BoDataType.dt_DATE); // Days of Month txDD = oForm.Items.Item("txDD").Specific; ItxDD = oForm.Items.Item("txDD"); txDD.DataBind.SetBound(true, "", "txDD"); oForm.DataSources.UserDataSources.Add("txRem", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100); // Days of Month txRem = oForm.Items.Item("txRem").Specific; ItxRem = oForm.Items.Item("txRem"); txRem.DataBind.SetBound(true, "", "txRem"); oForm.DataSources.UserDataSources.Add("txRef1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100); // Days of Month txRef1 = oForm.Items.Item("txRef1").Specific; ItxRef1 = oForm.Items.Item("txRef1"); txRef1.DataBind.SetBound(true, "", "txRef1"); oForm.DataSources.UserDataSources.Add("txRef2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100); // Days of Month txRef2 = oForm.Items.Item("txRef2").Specific; ItxRef2 = oForm.Items.Item("txRef2"); txRef2.DataBind.SetBound(true, "", "txRef2"); oForm.DataSources.UserDataSources.Add("txDS", SAPbouiCOM.BoDataType.dt_SUM); // Days of Month txDS = oForm.Items.Item("txDS").Specific; ItxDS = oForm.Items.Item("txDS"); txDS.DataBind.SetBound(true, "", "txDS"); oForm.DataSources.UserDataSources.Add("txCS", SAPbouiCOM.BoDataType.dt_SUM); // Days of Month txCS = oForm.Items.Item("txCS").Specific; ItxCS = oForm.Items.Item("txCS"); txCS.DataBind.SetBound(true, "", "txCS"); oForm.DataSources.UserDataSources.Add("chkPost", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month chkPost = oForm.Items.Item("chkPost").Specific; IchkPost = oForm.Items.Item("chkPost"); chkPost.DataBind.SetBound(true, "", "chkPost"); lnkBG = oForm.Items.Item("lnkBG").Specific; IchkPost = oForm.Items.Item("lnkBG"); }
private void InitiallizeForm() { // dtHead = oForm.DataSources.DataTables.Item("dtHead"); // dtHead.Rows.Add(1); dtPendingJEs.Columns.Add("V#"); dtPendingJEs.Columns.Add("Date"); dtPendingJEs.Columns.Add("Remarks"); dtPendingJEs.Columns.Add("Month"); dtPendingJEs.Columns.Add("Year"); dtPendingJEs.Columns.Add("Posted"); dtPendingJEs.Columns.Add("PostedJE"); dtPendingJEs.Columns.Add("Canceled"); dtPendingJEs.Columns.Add("CanceledJE"); oForm.Freeze(true); mtJE = oForm.Items.Item("mtJE").Specific; mtDet = oForm.Items.Item("mtDet").Specific; dtDet = oForm.DataSources.DataTables.Item("dtDet"); dtHead = oForm.DataSources.DataTables.Item("dtHead"); cbOr = oForm.Items.Item("cbOr").Specific; IcbOr = oForm.Items.Item("cbOr"); cbOr.ValidValues.Add("All", "All"); fillUserCb(); oForm.DataSources.UserDataSources.Add("txDN", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month txDN = oForm.Items.Item("txDN").Specific; ItxDN = oForm.Items.Item("txDN"); txDN.DataBind.SetBound(true, "", "txDN"); oForm.DataSources.UserDataSources.Add("txCJ", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month txCJ = oForm.Items.Item("txCJ").Specific; itxCJ = oForm.Items.Item("txCJ"); txCJ.DataBind.SetBound(true, "", "txCJ"); oForm.DataSources.UserDataSources.Add("txPJ", SAPbouiCOM.BoDataType.dt_LONG_NUMBER, 15); // Days of Month txPJ = oForm.Items.Item("txPJ").Specific; itxPJ = oForm.Items.Item("txPJ"); txPJ.DataBind.SetBound(true, "", "txPJ"); oForm.DataSources.UserDataSources.Add("txDD", SAPbouiCOM.BoDataType.dt_DATE); // Days of Month txDD = oForm.Items.Item("txDD").Specific; ItxDD = oForm.Items.Item("txDD"); txDD.DataBind.SetBound(true, "", "txDD"); oForm.DataSources.UserDataSources.Add("txRem", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 50); // Days of Month txRem = oForm.Items.Item("txRem").Specific; ItxRem = oForm.Items.Item("txRem"); txRem.DataBind.SetBound(true, "", "txRem"); oForm.DataSources.UserDataSources.Add("txRef1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 30); // Days of Month txRef1 = oForm.Items.Item("txRef1").Specific; ItxRef1 = oForm.Items.Item("txRef1"); txRef1.DataBind.SetBound(true, "", "txRef1"); oForm.DataSources.UserDataSources.Add("txRef2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 30); // Days of Month txRef2 = oForm.Items.Item("txRef2").Specific; ItxRef2 = oForm.Items.Item("txRef2"); txRef2.DataBind.SetBound(true, "", "txRef2"); oForm.DataSources.UserDataSources.Add("txDS", SAPbouiCOM.BoDataType.dt_SUM); // Days of Month txDS = oForm.Items.Item("txDS").Specific; ItxDS = oForm.Items.Item("txDS"); txDS.DataBind.SetBound(true, "", "txDS"); oForm.DataSources.UserDataSources.Add("txCS", SAPbouiCOM.BoDataType.dt_SUM); // Days of Month txCS = oForm.Items.Item("txCS").Specific; ItxCS = oForm.Items.Item("txCS"); txCS.DataBind.SetBound(true, "", "txCS"); oForm.DataSources.UserDataSources.Add("chkPost", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month chkPost = oForm.Items.Item("chkPost").Specific; IchkPost = oForm.Items.Item("chkPost"); chkPost.DataBind.SetBound(true, "", "chkPost"); oForm.DataSources.UserDataSources.Add("optPP", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month optPP = oForm.Items.Item("optPP").Specific; ioptPP = oForm.Items.Item("optPP"); optPP.DataBind.SetBound(true, "", "optPP"); oForm.DataSources.UserDataSources.Add("optC", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month optC = oForm.Items.Item("optC").Specific; ioptC = oForm.Items.Item("optC"); optC.DataBind.SetBound(true, "", "optC"); oForm.DataSources.UserDataSources.Add("optPC", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); // Days of Month optPC = oForm.Items.Item("optPC").Specific; ioptPC = oForm.Items.Item("optPC"); optPC.DataBind.SetBound(true, "", "optPC"); optC.GroupWith("optPP"); optPC.GroupWith("optPP"); optPP.Selected = true; btPost = oForm.Items.Item("btPost").Specific; lnkBG = oForm.Items.Item("lnkBG").Specific; IchkPost = oForm.Items.Item("lnkBG"); }
private void CriarFormularioComplexo() { SAPbouiCOM.Button oButton = null; SAPbouiCOM.Folder oFolder = null; SAPbouiCOM.OptionBtn oOptionBtn = null; SAPbouiCOM.CheckBox oCheckBox = null; SAPbouiCOM.ComboBox oComboBox = null; SAPbouiCOM.FormCreationParams oCreationParams = null; oCreationParams = ((SAPbouiCOM.FormCreationParams)(oApplication.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams))); oCreationParams.UniqueID = "frmComplex"; oCreationParams.FormType = "frmComplex"; oCreationParams.BorderStyle = BoFormBorderStyle.fbs_Sizable; oForm = oApplication.Forms.AddEx(oCreationParams); AddDataSourceNoForm(); oForm.Title = "Formulário Complexo"; oForm.Left = 300; oForm.ClientWidth = 200; oForm.Top = 100; oForm.ClientHeight = 140; oItem = oForm.Items.Add("1", BoFormItemTypes.it_BUTTON); oItem.Left = 5; oItem.Width = 65; oItem.Top = 110; oItem.Height = 19; oButton = ((SAPbouiCOM.Button)(oItem.Specific)); oButton.Caption = "OK"; oItem = oForm.Items.Add("2", BoFormItemTypes.it_BUTTON); oItem.Left = 75; oItem.Width = 65; oItem.Top = 110; oItem.Height = 19; oButton = ((SAPbouiCOM.Button)(oItem.Specific)); oButton.Caption = "Cancel"; oItem = oForm.Items.Add("Rect1", BoFormItemTypes.it_RECTANGLE); oItem.Left = 0; oItem.Width = 194; oItem.Top = 25; oItem.Height = 80; for (int i = 1; i <= 3; i++) { oItem = oForm.Items.Add("Folder" + i.ToString(), BoFormItemTypes.it_FOLDER); oItem.Left = (i - 1) * 100; oItem.Width = 100; oItem.Top = 6; oItem.Height = 19; oFolder = ((SAPbouiCOM.Folder)(oItem.Specific)); oFolder.Caption = "Folder" + i.ToString(); oFolder.DataBind.SetBound(true, "", "FolderDS"); if (i == 1) { oFolder.Select(); } else { oFolder.GroupWith("Folder" + Convert.ToString(i - 1)); } } for (int i = 1; i <= 3; i++) { oItem = oForm.Items.Add("OptBtn" + i.ToString(), BoFormItemTypes.it_OPTION_BUTTON); oItem.Left = 20; oItem.Width = 120; oItem.Top = 30 + (i - 1) * 19; oItem.Height = 19; oItem.FromPane = 1; oItem.ToPane = 1; oOptionBtn = ((SAPbouiCOM.OptionBtn)(oItem.Specific)); oOptionBtn.Caption = string.Format("Botão de Opção {0}", i); if (i > 1) { oOptionBtn.GroupWith("OptBtn" + Convert.ToString(i - 1)); } oOptionBtn.DataBind.SetBound(true, "", "OptBtnDS"); } for (int i = 1; i <= 3; i++) { oItem = oForm.Items.Add("CheckBox" + i.ToString(), BoFormItemTypes.it_CHECK_BOX); oItem.Left = 20; oItem.Width = 100; oItem.Top = 30 + (i - 1) * 19; oItem.Height = 19; oItem.FromPane = 2; oItem.ToPane = 2; oCheckBox = ((SAPbouiCOM.CheckBox)(oItem.Specific)); oCheckBox.Caption = string.Format("Check Box {0}", i); oCheckBox.DataBind.SetBound(true, "", string.Format("CheckDS{0}", i)); } for (int i = 1; i <= 3; i++) { oItem = oForm.Items.Add("ComboBox" + i.ToString(), BoFormItemTypes.it_COMBO_BOX); oItem.Left = 20; oItem.Width = 100; oItem.Top = 33 + (i - 1) * 19; oItem.Height = 19; oItem.FromPane = 3; oItem.ToPane = 3; oComboBox = ((SAPbouiCOM.ComboBox)(oItem.Specific)); oComboBox.ValidValues.Add("0", "Selecione"); for (int x = 1; x < 10; x++) { oComboBox.ValidValues.Add(x.ToString(), string.Format("Item {0}", x)); } oComboBox.Select("0", BoSearchKey.psk_ByValue); oItem.DisplayDesc = true; } oForm.PaneLevel = 1; }
private void SetItemEnabled(SAPbouiCOM.Form oForm) { string strTransID = string.Empty; string strRejTran = string.Empty; string strStatus = string.Empty; string strAcctCd = string.Empty; string strTYPE = string.Empty; try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); strTransID = oDB_M.GetValue("U_JDTDOC", 0).Trim(); strRejTran = oDB_M.GetValue("U_RJDTDOC", 0).Trim(); strTYPE = oDB_M.GetValue("U_TYPE", 0).Trim(); oCheckBox = (SAPbouiCOM.CheckBox)oForm.Items.Item("chkACCTIN").Specific; oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("mtx").Specific; FN.SetAutoManagedAttribute(ref oForm, "edtDOCNUM,cboTYPE,edtCENTCD,edtCENTNM,cboSTATUS,edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKBRCH,edtBNKHOLD,edtAMT,edtJDTDOC,edtRJDTDOC,btnTRAN,btnCANCTR,btnPOPUP,chkACCTIN,mtx", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_All, BoModeVisualBehavior.mvb_False); FN.SetAutoManagedAttribute(ref oForm, "edtDOCNUM,cboTYPE,edtCENTCD,edtCENTNM,cboSTATUS,edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKBRCH,edtBNKHOLD,edtAMT,chkACCTIN", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Find, BoModeVisualBehavior.mvb_True); // 분개처리 상태 if (string.IsNullOrEmpty(strTransID) == false && string.IsNullOrEmpty(strRejTran)) { FN.SetAutoManagedAttribute(ref oForm, "btnCANCTR", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); } // 일반문서상태 else if (string.IsNullOrEmpty(strTransID)) { //FN.SetItemEnable(oForm, "btnCANCTR", false); if (oCheckBox.Checked || strTYPE == "O") { //strAcctCd = FN.GetRecordsetValue(" SELECT U_RMK1 FROM [@KIS_AD00201] WHERE Code = 'SO19' AND U_SMLCD = 'U204' "); //oDB_M.SetValue("U_ACCTCD", 0, strAcctCd); FN.SetAutoManagedAttribute(ref oForm, "edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKHOLD,edtAMT,btnTRAN,chkACCTIN,cboACCTCD", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, "cboTYPE,edtCENTCD,edtCENTNM,edtDOCDT,cboMETHOD,edtBNKACCT,edtBNKHOLD,edtAMT,chkACCTIN,cboACCTCD", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); oMatrix.Clear(); oMatrix.FlushToDataSource(); } else { //oDB_M.SetValue("U_ACCTCD", 0, ""); FN.SetAutoManagedAttribute(ref oForm, "edtDOCDT,cboMETHOD,cboACCTCD,edtBNKACCT,edtBNKHOLD,mtx,btnPOPUP,btnTRAN,chkACCTIN", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True); FN.SetAutoManagedAttribute(ref oForm, "cboTYPE,edtCENTCD,edtCENTNM,edtDOCDT,cboMETHOD,edtBNKACCT,edtBNKHOLD,btnPOPUP,chkACCTIN,mtx", BoAutoManagedAttr.ama_Editable, BoAutoFormMode.afm_Add, BoModeVisualBehavior.mvb_True); } } } catch (Exception) { throw; } }
private void ClearUnManagedObject() { if (oLinkedButton != null) { Marshal.ReleaseComObject(oLinkedButton); } oLinkedButton = null; if (oCheckBox != null) { Marshal.ReleaseComObject(oCheckBox); } oCheckBox = null; if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = null; if (oDB_M != null) { Marshal.ReleaseComObject(oDB_M); } oDB_M = null; if (oDB_1 != null) { Marshal.ReleaseComObject(oDB_1); } oDB_1 = null; if (oMatrix != null) { Marshal.ReleaseComObject(oMatrix); } oMatrix = null; if (pMatrix != null) { Marshal.ReleaseComObject(pMatrix); } pMatrix = null; if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null; if (oUDS != null) { Marshal.ReleaseComObject(oUDS); } oUDS = null; if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null; if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null; if (pForm != null) { Marshal.ReleaseComObject(pForm); } pForm = null; if (oForm != null) { Marshal.ReleaseComObject(oForm); } oForm = null; //ADD YOUR ACTION CODE HERE ... System.GC.Collect(); System.GC.WaitForPendingFinalizers(); }
private bool BeforeSaveData_Validate(SAPbouiCOM.Form oForm) { bool rtnValue = true; try { oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); oCheckBox = (SAPbouiCOM.CheckBox)oForm.Items.Item("chkACCTIN").Specific; if (FN.GetItemValue(ref oForm, "cboTYPE") == "") { B1Connections.theAppl.StatusBar.SetText("수금/지급 구분이 선택되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); FN.ItemClick(ref oForm, "cboTYPE"); rtnValue = false; } else if (FN.GetItemValue(ref oForm, "edtCENTCD") == "") { B1Connections.theAppl.StatusBar.SetText("지국이 입력되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); FN.ItemClick(ref oForm, "edtCENTCD"); rtnValue = false; } else if (FN.GetItemValue(ref oForm, "edtDOCDT") == "") { B1Connections.theAppl.StatusBar.SetText("전기일이 입력되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); FN.ItemClick(ref oForm, "edtDOCDT"); rtnValue = false; } else if (FN.GetItemValue(ref oForm, "cboMETHOD") == "") { B1Connections.theAppl.StatusBar.SetText("입금/지급방법이 선택되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); FN.ItemClick(ref oForm, "cboMETHOD"); rtnValue = false; } else if (FN.GetItemValue(ref oForm, "edtBNKACCT") == "") { if (FN.GetItemValue(ref oForm, "cboMETHOD") == "S04") { B1Connections.theAppl.StatusBar.SetText("계좌번호가 입력되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); FN.ItemClick(ref oForm, "edtBNKACCT"); rtnValue = false; } } if (oCheckBox.Checked) { if (FN.GetItemValue(ref oForm, "cboACCTCD") == "") { B1Connections.theAppl.StatusBar.SetText("계정과목이 입력되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); FN.ItemClick(ref oForm, "cboACCTCD"); rtnValue = false; } else if (FN.GetItemValue(ref oForm, "edtAMT") == "0.0") { B1Connections.theAppl.StatusBar.SetText("금액이 입력되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); FN.ItemClick(ref oForm, "edtAMT"); rtnValue = false; } } else { if (oMatrix.VisualRowCount <= 0) { B1Connections.theAppl.StatusBar.SetText("메트릭스에 청구금액이 입력되지 않았습니다.", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); rtnValue = false; } } } catch (Exception) { throw; } return rtnValue; }
public virtual void ET_chkACCTIN_AFItemPressed(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oCheckBox = ((SAPbouiCOM.CheckBox)(oForm.Items.Item("chkACCTIN").Specific)); // ADD YOUR ACTION CODE HERE ... SetItemEnabled(oForm); //if (pVal.ItemChanged) //{ oDB_M = oForm.DataSources.DBDataSources.Item("@KIS_SO0320T_HRD"); oDB_M.SetValue("U_METHOD", 0, ""); oDB_M.SetValue("U_ACCTCD", 0, ""); SetComboBox_Method(oForm); //} }
public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings) { bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings); try { oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); //Lista := New list<string>; FSBOf.LoadForm(xmlPath, "VID_Monitor.srf", uid); //EnableCrystal := true; oForm = FSBOApp.Forms.Item(uid); oForm.Freeze(true); oForm.AutoManaged = false; oForm.SupportedModes = -1; // afm_All oForm.EnableMenu("1282", false); //Crear oForm.EnableMenu("1281", false); //Actualizar // Ok Ad Fnd Vw Rq Sec //Lista.Add('DocNum , f, f, t, f, n, 1'); //Lista.Add('DocDate , f, t, f, f, r, 1'); //Lista.Add('CardCode , f, t, t, f, r, 1'); //FSBOf.SetAutoManaged(var oForm, Lista); oDBDSHeader = oForm.DataSources.DBDataSources.Add("@VID_FELOG"); oDBDSD = oForm.DataSources.DBDataSources.Add("@VID_FELOGD"); oForm.DataSources.UserDataSources.Add("FechaD", BoDataType.dt_DATE, 10); oEditText = (EditText)(oForm.Items.Item("FechaD").Specific); oEditText.DataBind.SetBound(true, "", "FechaD"); oEditText.Value = DateTime.Now.ToString("yyyyMMdd"); oForm.DataSources.UserDataSources.Add("FechaH", BoDataType.dt_DATE, 10); oEditText = (EditText)(oForm.Items.Item("FechaH").Specific); oEditText.DataBind.SetBound(true, "", "FechaH"); oEditText.Value = DateTime.Now.ToString("yyyyMMdd"); oForm.DataSources.UserDataSources.Add("chk_Todo", BoDataType.dt_SHORT_TEXT, 1); oCheckBox = (CheckBox)(oForm.Items.Item("chk_Todo").Specific); oCheckBox.DataBind.SetBound(true, "", "chk_Todo"); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox.Checked = false; oForm.DataSources.UserDataSources.Add("Rechazados", BoDataType.dt_SHORT_TEXT, 1); oCheckBox = (CheckBox)(oForm.Items.Item("Rechazados").Specific); oCheckBox.DataBind.SetBound(true, "", "Rechazados"); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox.Checked = true; oForm.DataSources.UserDataSources.Add("Pendientes", BoDataType.dt_SHORT_TEXT, 1); oCheckBox = (CheckBox)(oForm.Items.Item("Pendientes").Specific); oCheckBox.DataBind.SetBound(true, "", "Pendientes"); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox.Checked = true; oForm.DataSources.UserDataSources.Add("Aceptados", BoDataType.dt_SHORT_TEXT, 1); oCheckBox = (CheckBox)(oForm.Items.Item("Aceptados").Specific); oCheckBox.DataBind.SetBound(true, "", "Aceptados"); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox.Checked = false; oForm.DataSources.UserDataSources.Add("DadoBaja", BoDataType.dt_SHORT_TEXT, 1); oCheckBox = (CheckBox)(oForm.Items.Item("DadoBaja").Specific); oCheckBox.DataBind.SetBound(true, "", "DadoBaja"); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox.Checked = false; oForm.DataSources.UserDataSources.Add("Errores", BoDataType.dt_SHORT_TEXT, 1); oCheckBox = (CheckBox)(oForm.Items.Item("Errores").Specific); oCheckBox.DataBind.SetBound(true, "", "Errores"); oCheckBox.ValOn = "Y"; oCheckBox.ValOff = "N"; oCheckBox.Checked = true; oDataTable = oForm.DataSources.DataTables.Add("dt"); oGrid = (Grid)(oForm.Items.Item("grid").Specific); oGrid.DataTable = oDataTable; if (GlobalSettings.RunningUnderSQLServer) { s = "select ISNULL(TaxIdNum,'') TaxIdNum from OADM "; } else { s = @"select IFNULL(""TaxIdNum"",'') ""TaxIdNum"" from ""OADM"" "; } oRecordSet.DoQuery(s); if (oRecordSet.RecordCount == 0) { throw new Exception("Debe ingresar RUC de Emisor, Gestión -> Inicialización Sistema -> Detalle Sociedad -> Datos de Contabilidad -> ID fiscal general 1"); } else { RUC = ((System.String)oRecordSet.Fields.Item("TaxIdNum").Value).Trim(); } CargarDatosPE(); } catch (Exception e) { OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); } oForm.Freeze(false); return(Result); }//fin InitForm
}//fin FormEvent private void CargarDatosPE() { SAPbouiCOM.EditTextColumn oEditColumn; SAPbouiCOM.CheckBox oChkRechazados; SAPbouiCOM.CheckBox oChkPendientes; SAPbouiCOM.CheckBox oChkAceptados; SAPbouiCOM.CheckBox oChkDadoBaja; SAPbouiCOM.CheckBox oChkErrores; String FechaD, FechaH, Status; try { oForm.Freeze(true); oChkRechazados = (CheckBox)(oForm.Items.Item("Rechazados").Specific); oChkPendientes = (CheckBox)(oForm.Items.Item("Pendientes").Specific); oChkAceptados = (CheckBox)(oForm.Items.Item("Aceptados").Specific); oChkDadoBaja = (CheckBox)(oForm.Items.Item("DadoBaja").Specific); oChkErrores = (CheckBox)(oForm.Items.Item("Errores").Specific); if ((oChkRechazados.Checked) || (oChkPendientes.Checked) || (oChkAceptados.Checked) || (oChkErrores.Checked)) { if (GlobalSettings.RunningUnderSQLServer) { Status = "and T0.U_Status in ("; Status = Status + (oChkRechazados.Checked ? "'RZ'," : ""); Status = Status + (oChkPendientes.Checked ? "'EC'," : ""); Status = Status + (oChkAceptados.Checked ? "'RR'," : ""); Status = Status + (oChkDadoBaja.Checked ? "'DB'," : ""); Status = Status + (oChkErrores.Checked ? "'EE'," : ""); Status = Status.Substring(0, Status.Length - 1); Status = Status + ")"; } else { Status = @"and T0.""U_Status"" in ("; Status = Status + (oChkRechazados.Checked ? "'RZ'," : ""); Status = Status + (oChkPendientes.Checked ? "'EC'," : ""); Status = Status + (oChkAceptados.Checked ? "'RR'," : ""); Status = Status + (oChkDadoBaja.Checked ? "'DB'," : ""); Status = Status + (oChkErrores.Checked ? "'EE'," : ""); Status = Status.Substring(0, Status.Length - 1); Status = Status + ")"; } } else if ((!oChkRechazados.Checked) && (!oChkPendientes.Checked) && (!oChkAceptados.Checked) && (!oChkDadoBaja.Checked) && (!oChkErrores.Checked)) { //en caso de no encontrar ninguno marcado sale de la funcion oForm.Freeze(false); return; } else { Status = ""; } if (GlobalSettings.RunningUnderSQLServer) { s = @"SELECT LTRIM(STR(T0.U_DocEntry,18,0)) 'DocEntry' ,CASE U_ObjType WHEN '13' THEN (SELECT DocNum FROM OINV WHERE DocEntry = T0.U_DocEntry) WHEN '14' THEN (SELECT DocNum FROM ORIN WHERE DocEntry = T0.U_DocEntry) WHEN '15' THEN (SELECT DocNum FROM ODLN WHERE DocEntry = T0.U_DocEntry) WHEN '67' THEN (SELECT DocNum FROM OWTR WHERE DocEntry = T0.U_DocEntry) WHEN '21' THEN (SELECT DocNum FROM ORPD WHERE DocEntry = T0.U_DocEntry) END 'DocNum' ,T0.U_TipoDoc 'TipoDoc' ,ISNULL(T0.U_SeriePE,'') 'SeriePE' ,LTRIM(STR(T0.U_FolioNum,18,0)) 'Folio' ,(SELECT C1.Descr FROM CUFD C0 JOIN UFD1 C1 ON C1.TableID=C0.TableID AND C1.FieldID=C0.FieldID WHERE C0.TableID = '@VID_FELOG' AND C0.AliasID='Status' AND C1.FldValue= T0.U_Status) 'Estado' ,T0.U_Status ,T0.U_Message 'Mensaje' ,T0.U_ObjType 'ObjType' ,T0.U_Path 'Path' ,T0.U_ExtFolio 'ExtFolio' ,T0.DocEntry 'Key' ,ISNULL(T0.U_Id,'0') 'Id' ,ISNULL(T0.U_Validation,'') 'Validation' FROM [@vid_felog] T0 WITH (NOLOCK) JOIN OUSR T2 ON T2.USER_CODE = T0.U_UserCode WHERE {0} {3} AND ISNULL(T0.U_DocDate, T0.CreateDate) BETWEEN '{1}' AND '{2}' ORDER BY T0.DocEntry DESC"; } else { s = @"SELECT LTRIM(TO_ALPHANUM(T0.""U_DocEntry"")) ""DocEntry"" ,CASE ""U_ObjType"" WHEN '13' THEN (SELECT ""DocNum"" FROM ""OINV"" WHERE ""DocEntry"" = T0.""U_DocEntry"") WHEN '14' THEN (SELECT ""DocNum"" FROM ""ORIN"" WHERE ""DocEntry"" = T0.""U_DocEntry"") WHEN '15' THEN (SELECT ""DocNum"" FROM ""ODLN"" WHERE ""DocEntry"" = T0.""U_DocEntry"") WHEN '67' THEN (SELECT ""DocNum"" FROM ""OWTR"" WHERE ""DocEntry"" = T0.""U_DocEntry"") WHEN '21' THEN (SELECT ""DocNum"" FROM ""ORPD"" WHERE ""DocEntry"" = T0.""U_DocEntry"") END ""DocNum"" ,T0.""U_TipoDoc"" ""TipoDoc"" ,IFNULL(T0.""U_SeriePE"",'') ""SeriePE"" ,LTRIM(TO_ALPHANUM(T0.""U_FolioNum"")) ""Folio"" ,(SELECT C1.""Descr"" FROM ""CUFD"" C0 JOIN ""UFD1"" C1 ON C1.""TableID""=C0.""TableID"" AND C1.""FieldID""=C0.""FieldID"" WHERE C0.""TableID"" = '@VID_FELOG' AND C0.""AliasID""='Status' AND C1.""FldValue""= T0.""U_Status"") ""Estado"" ,T0.""U_Status"" ,T0.""U_Message"" ""Mensaje"" ,T0.""U_ObjType"" ""ObjType"" ,T0.""U_Path"" ""Path"" ,T0.""U_ExtFolio"" ""ExtFolio"" ,T0.""DocEntry"" ""Key"" ,IFNULL(T0.""U_Id"",'0') ""Id"" ,IFNULL(T0.""U_Validation"",'') ""Validation"" FROM ""@VID_FELOG"" T0 JOIN ""OUSR"" T2 on T2.""USER_CODE"" = T0.""U_UserCode"" WHERE {0} {3} AND IFNULL(T0.""U_DocDate"", T0.""CreateDate"") BETWEEN '{1}' AND '{2}' ORDER BY T0.""DocEntry"" DESC "; } oCheckBox = (CheckBox)(oForm.Items.Item("chk_Todo").Specific); oEditText = (EditText)(oForm.Items.Item("FechaD").Specific); FechaD = (System.String)(oEditText.Value).Trim(); oEditText = (EditText)(oForm.Items.Item("FechaH").Specific); FechaH = (System.String)(oEditText.Value).Trim(); if (GlobalSettings.RunningUnderSQLServer) { s = String.Format(s, !oCheckBox.Checked ? "T0.U_UserCode = '" + FSBOApp.Company.UserName + "'" : "1=1", FechaD, FechaH, Status); } else { s = String.Format(s, !oCheckBox.Checked ? @"T0.""U_UserCode"" = '" + FSBOApp.Company.UserName + "'" : "1=1", FechaD, FechaH, Status); } oDataTable.ExecuteQuery(s); oGrid.Columns.Item("TipoDoc").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("TipoDoc")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Tipo Documento"; oGrid.Columns.Item("DocEntry").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("DocEntry")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Llave SAP"; oEditColumn.LinkedObjectType = "13"; oEditColumn.RightJustified = true; oGrid.Columns.Item("DocNum").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("DocNum")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Número SAP"; oEditColumn.RightJustified = true; oGrid.Columns.Item("SeriePE").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("SeriePE")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Número Serie"; oEditColumn.RightJustified = true; oGrid.Columns.Item("Folio").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Folio")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Número Correlativo"; oEditColumn.RightJustified = true; oGrid.Columns.Item("Estado").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Estado")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Estado"; oGrid.Columns.Item("U_Status").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("U_Status")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "U_Status"; oEditColumn.Visible = false; oGrid.Columns.Item("Mensaje").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Mensaje")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Comentario"; oGrid.Columns.Item("ObjType").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("ObjType")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "ObjType"; oEditColumn.Visible = false; oGrid.Columns.Item("Path").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Path")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Documento"; oEditColumn.Visible = false; oGrid.Columns.Item("ExtFolio").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("ExtFolio")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "IdDocumento"; oEditColumn.Visible = true; oGrid.Columns.Item("Key").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Key")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Key"; oEditColumn.Visible = false; oGrid.Columns.Item("Id").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Id")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Id"; oEditColumn.Visible = false; oGrid.Columns.Item("Validation").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Validation")); oEditColumn = (EditTextColumn)(oColumn); oEditColumn.Editable = false; oEditColumn.TitleObject.Caption = "Validation"; oEditColumn.Visible = false; oGrid.AutoResizeColumns(); } catch (Exception e) { OutLog("CargarDatosPE : " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.StatusBar.SetText("CargarDatosPE : " + e.Message + " ** Trace: " + e.StackTrace, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error); } oForm.Freeze(false); } //fin CargarDatosPE
private void AddItemsToPVForm() { UserDataSourceHelper.AddUserDataSource(this.oFormPV, "OptBtnDS", BoDataType.dt_SHORT_TEXT, 1); UserDataSourceHelper.AddUserDataSource(this.oFormPV, "CheckDS1", BoDataType.dt_SHORT_TEXT, 1); UserDataSourceHelper.AddUserDataSource(this.oFormPV, "CheckDS2", BoDataType.dt_SHORT_TEXT, 1); UserDataSourceHelper.AddUserDataSource(this.oFormPV, "CheckDS3", BoDataType.dt_SHORT_TEXT, 1); //adcionar check box ao folder this.oItem = this.oFormPV.Items.Item("126"); for (int i = 1; i <= 3; i++) { this.oCheckBox = UIHelper.AddCheckBoxAoFormulario( this.oFormPV , "CheckBox" + i.ToString() , oItem.Left , 100 , this.oItem.Top + (i - 1) * 19 , 19 , "Check Box" + i.ToString() , true , 5 , 5 ); this.oCheckBox.DataBind.SetBound(true, "", "CheckDS" + i.ToString()); } this.oItem = this.oFormPV.Items.Item("44"); for (int i = 1; i <= 3; i++) { //this.oNewItem = this.oFormPV.Items.Add("OptBtn" + i.ToString(), BoFormItemTypes.it_OPTION_BUTTON); //this.oNewItem.Left = oItem.Left; //this.oNewItem.Width = 100; //this.oNewItem.Top = this.oItem.Top + (i - 1) * 19; //this.oNewItem.Height = 19; //this.oNewItem.FromPane = 5; //this.oNewItem.ToPane = 5; //this.oOptionBtn = (SAPbouiCOM.OptionBtn)oNewItem.Specific; //this.oOptionBtn.Caption = "Option Button" + i.ToString(); //if (i > 1) //{ // oOptionBtn.GroupWith("OptBtn" + Convert.ToString(i - 1)); //} this.oOptionBtn = UIHelper.AddOptionButtonAoFormulario( this.oFormPV , "OptBtn" + i.ToString() , oItem.Left , 100 , this.oItem.Top + (i - 1) * 19 , 19 , "OptBtn" + i.ToString() , (i > 1) ? "OptBtn" + Convert.ToString(i - 1) : "" , true , 5 , 5 ); this.oOptionBtn.DataBind.SetBound(true, "", "oPTBtnDS"); } }
public virtual void ET_chkUSRGBN3_AFClick(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oCheckBox = ((SAPbouiCOM.CheckBox)(oForm.Items.Item("chkUSRGBN3").Specific)); // ADD YOUR ACTION CODE HERE ... SetUserGbn(oForm, "chkUSRGBN3"); }
private void ClearUnManagedObject() { if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null; if (oCheckBox != null) { Marshal.ReleaseComObject(oCheckBox); } oCheckBox = null; if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null; if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null; if (oGrid != null) { Marshal.ReleaseComObject(oGrid); } oGrid = null; // ADD YOUR ACTION CODE HERE ... System.GC.Collect(); System.GC.WaitForPendingFinalizers(); }
public void LimpiarChkForm(string oForm, IItemEvent campo) { if (oForm == "BOPC") { SAPbouiCOM.Form oFormBOPC = null; oFormBOPC = sboapp.Forms.Item("BOPC"); SAPbouiCOM.CheckBox chk01 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_ProySN").Specific; SAPbouiCOM.CheckBox chk02 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim1SN").Specific; SAPbouiCOM.CheckBox chk03 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim2SN").Specific; SAPbouiCOM.CheckBox chk04 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim3SN").Specific; SAPbouiCOM.CheckBox chk05 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim4SN").Specific; SAPbouiCOM.CheckBox chk06 = (SAPbouiCOM.CheckBox)oFormBOPC.Items.Item("BO_Dim5SN").Specific; EditText txtID = (EditText)oFormBOPC.Items.Item("BO_User").Specific; EditText txt01 = (EditText)oFormBOPC.Items.Item("BO_Proy").Specific; EditText txt02 = (EditText)oFormBOPC.Items.Item("BO_Dim1").Specific; EditText txt03 = (EditText)oFormBOPC.Items.Item("BO_Dim2").Specific; EditText txt04 = (EditText)oFormBOPC.Items.Item("BO_Dim3").Specific; EditText txt05 = (EditText)oFormBOPC.Items.Item("BO_Dim4").Specific; EditText txt06 = (EditText)oFormBOPC.Items.Item("BO_Dim5").Specific; txtID.Item.Click(); switch (campo.ItemUID) { case "BO_ProySN": if (chk01.Checked == true) { txt01.Item.Enabled = true; } else { txt01.Item.Enabled = false; } break; case "BO_Dim1SN": if (chk02.Checked == true) { txt02.Item.Enabled = true; } else { txt02.Item.Enabled = false; } break; case "BO_Dim2SN": if (chk03.Checked == true) { txt03.Item.Enabled = true; } else { txt03.Item.Enabled = false; } break; case "BO_Dim3SN": if (chk04.Checked == true) { txt04.Item.Enabled = true; } else { txt04.Item.Enabled = false; } break; case "BO_Dim4SN": if (chk05.Checked == true) { txt05.Item.Enabled = true; } else { txt05.Item.Enabled = false; } break; case "BO_Dim5SN": if (chk06.Checked == true) { txt06.Item.Enabled = true; } else { txt06.Item.Enabled = false; } break; default: break; } } }
private void InitiallizeForm() { //dtItem = oForm.DataSources.DataTables.Add("dtItem"); //dtItem.Columns.Add("ItemCode", BoFieldsType.ft_AlphaNumeric, 50); //dtItem.Columns.Add("ItemName", BoFieldsType.ft_AlphaNumeric, 100); //dtItem.Columns.Add("FrignName", BoFieldsType.ft_AlphaNumeric, 100); //dtItem.Columns.Add("ItemGroup", BoFieldsType.ft_AlphaNumeric, 50); //dtItem.Columns.Add("AI", BoFieldsType.ft_AlphaNumeric, 100); //dtItem.Columns.Add("Remarks", BoFieldsType.ft_AlphaNumeric, 100); oForm.Freeze(true); dbQUT1 = oForm.DataSources.DBDataSources.Item("QUT1"); mtItems = (SAPbouiCOM.Matrix)oForm.Items.Item("38").Specific; oItemRef = oForm.Items.Item("20"); try { oForm.DataSources.UserDataSources.Add("FolderDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1); oItem = oForm.Items.Add("ItemImage", SAPbouiCOM.BoFormItemTypes.it_PICTURE); oItem.Top = oItemRef.Top; oItem.Height = oItemRef.Height + 100; oItem.Left = oItemRef.Left + oItemRef.Width + 20; oItem.Width = oItemRef.Width + 200; oItem.Visible = true; ItemImage = (SAPbouiCOM.PictureBox)oItem.Specific; oItem.LinkTo = oItemRef.UniqueID; oItemRef = oForm.Items.Item("138"); oItem = oForm.Items.Add("fldNI", SAPbouiCOM.BoFormItemTypes.it_FOLDER); oItem.Width = oItemRef.Width; oItem.Left = oItemRef.Left + 400; oItem.Top = oItemRef.Top; oItem.Height = oItemRef.Height; SAPbouiCOM.Folder fldNI = (SAPbouiCOM.Folder)oItem.Specific; fldNI.Pane = 101; fldNI.AutoPaneSelection = true; fldNI.Caption = "New Item"; fldNI.DataBind.SetBound(true, "", "FolderDS"); fldNI.GroupWith("1320002137"); oItemRef = oForm.Items.Item("48"); oItem = oForm.Items.Add("lblItCode", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top - 60; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "txItCode"; SAPbouiCOM.StaticText lblItCode = (SAPbouiCOM.StaticText)oItem.Specific; lblItCode.Caption = "Item Code"; oItem = oForm.Items.Add("txItCode", SAPbouiCOM.BoFormItemTypes.it_EDIT); oItem.Top = oItemRef.Top - 60; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblItCode"; txItCode = (SAPbouiCOM.EditText)oItem.Specific; // txItCode.DataBind.SetBound(true, "dtItem", "ItemCode"); oItemRef = oForm.Items.Item("lblItCode"); oItem = oForm.Items.Add("lblName", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblItCode"; SAPbouiCOM.StaticText lblName = (SAPbouiCOM.StaticText)oItem.Specific; lblName.Caption = "Description"; oItem = oForm.Items.Add("txName", SAPbouiCOM.BoFormItemTypes.it_EDIT); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 250; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblName"; txName = (SAPbouiCOM.EditText)oItem.Specific; oItemRef = oForm.Items.Item("lblName"); oItem = oForm.Items.Add("lblIG", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblName"; SAPbouiCOM.StaticText lblIG = (SAPbouiCOM.StaticText)oItem.Specific; lblIG.Caption = "Item Group"; oItem = oForm.Items.Add("cbIG", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblIG"; cbIG = (SAPbouiCOM.ComboBox)oItem.Specific; oItem.DisplayDesc = true; oItemRef = oForm.Items.Item("lblIG"); oItem = oForm.Items.Add("lblPM1", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblIG"; SAPbouiCOM.StaticText lblPM1 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM1.Caption = "Type "; oItem = oForm.Items.Add("cbPM1", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbIG"; cbPM1 = (SAPbouiCOM.ComboBox)oItem.Specific; oItem.DisplayDesc = true; oItemRef = oForm.Items.Item("lblPM1"); oItem = oForm.Items.Add("lblPM2", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblPM1"; SAPbouiCOM.StaticText lblPM2 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM2.Caption = "Style"; oItem = oForm.Items.Add("cbPM2", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM1"; cbPM2 = (SAPbouiCOM.ComboBox)oItem.Specific; oItem.DisplayDesc = true; oItemRef = oForm.Items.Item("lblPM2"); oItem = oForm.Items.Add("lblPM3", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblPM2"; SAPbouiCOM.StaticText lblPM3 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM3.Caption = "Frame"; oItem = oForm.Items.Add("cbPM3", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM2"; cbPM3 = (SAPbouiCOM.CheckBox)oItem.Specific; oForm.DataSources.UserDataSources.Add("cbPM3", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month cbPM3.DataBind.SetBound(true, "", "cbPM3"); oItem.DisplayDesc = true; oItemRef = oForm.Items.Item("lblPM3"); oItem = oForm.Items.Add("lblPM4", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblPM3"; SAPbouiCOM.StaticText lblPM4 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM4.Caption = "Panel"; oItem = oForm.Items.Add("cbPM4", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM3"; oItem.DisplayDesc = true; cbPM4 = (SAPbouiCOM.CheckBox)oItem.Specific; oForm.DataSources.UserDataSources.Add("cbPM4", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month cbPM4.DataBind.SetBound(true, "", "cbPM4"); oItemRef = oForm.Items.Item("lblPM4"); oItem = oForm.Items.Add("lblPM5", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblPM4"; SAPbouiCOM.StaticText lblPM5 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM5.Caption = "Glass"; oItem = oForm.Items.Add("cbPM5", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM4"; oItem.DisplayDesc = true; cbPM5 = (SAPbouiCOM.CheckBox)oItem.Specific; oForm.DataSources.UserDataSources.Add("cbPM5", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month cbPM5.DataBind.SetBound(true, "", "cbPM5"); oItemRef = oForm.Items.Item("lblPM5"); oItem = oForm.Items.Add("lblPM6", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblPM5"; SAPbouiCOM.StaticText lblPM6 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM6.Caption = "FlyScreen"; oItem = oForm.Items.Add("cbPM6", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM5"; oItem.DisplayDesc = true; cbPM6 = (SAPbouiCOM.CheckBox)oItem.Specific; oForm.DataSources.UserDataSources.Add("cbPM6", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month cbPM6.DataBind.SetBound(true, "", "cbPM6"); oItemRef = oForm.Items.Item("lblPM6"); oItem = oForm.Items.Add("lblPM7", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblPM6"; SAPbouiCOM.StaticText lblPM7 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM7.Caption = "Color"; oItem = oForm.Items.Add("cbPM7", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM6"; oItem.DisplayDesc = true; cbPM7 = (SAPbouiCOM.ComboBox)oItem.Specific; oItemRef = oForm.Items.Item("lblPM7"); oItem = oForm.Items.Add("lblPM8", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblPM7"; SAPbouiCOM.StaticText lblPM8 = (SAPbouiCOM.StaticText)oItem.Specific; lblPM8.Caption = "PV Box"; oItem = oForm.Items.Add("cbPM8", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + oItemRef.Width; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM7"; oItem.DisplayDesc = true; cbPM8 = (SAPbouiCOM.CheckBox)oItem.Specific; oForm.DataSources.UserDataSources.Add("cbPM8", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month cbPM8.DataBind.SetBound(true, "", "cbPM8"); oItemRef = oForm.Items.Item("cbPM1"); oItem = oForm.Items.Add("lblLength", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + 300; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = oItemRef.UniqueID; SAPbouiCOM.StaticText lblLength = (SAPbouiCOM.StaticText)oItem.Specific; lblLength.Caption = "Length"; oItem = oForm.Items.Add("txL", SAPbouiCOM.BoFormItemTypes.it_EDIT); oItem.Top = oItemRef.Top; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left + 400; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM8"; oItem.DisplayDesc = true; txL = (SAPbouiCOM.EditText)oItem.Specific; oForm.DataSources.UserDataSources.Add("txL", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month txL.DataBind.SetBound(true, "", "txL"); oItemRef = oForm.Items.Item("lblLength"); oItem = oForm.Items.Add("lblWidth", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblLength"; SAPbouiCOM.StaticText lblW = (SAPbouiCOM.StaticText)oItem.Specific; lblW.Caption = "Width"; oItemRef = oForm.Items.Item("txL"); oItem = oForm.Items.Add("txW", SAPbouiCOM.BoFormItemTypes.it_EDIT); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "txL"; oItem.DisplayDesc = true; txW = (SAPbouiCOM.EditText)oItem.Specific; oForm.DataSources.UserDataSources.Add("txW", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month txW.DataBind.SetBound(true, "", "txW"); oItemRef = oForm.Items.Item("lblWidth"); oItem = oForm.Items.Add("lblHeight", SAPbouiCOM.BoFormItemTypes.it_STATIC); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = oItemRef.Width; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "lblWidth"; SAPbouiCOM.StaticText lblH = (SAPbouiCOM.StaticText)oItem.Specific; lblH.Caption = "Height"; oItemRef = oForm.Items.Item("txW"); oItem = oForm.Items.Add("txH", SAPbouiCOM.BoFormItemTypes.it_EDIT); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height; oItem.Left = oItemRef.Left; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "txW"; oItem.DisplayDesc = true; txH = (SAPbouiCOM.EditText)oItem.Specific; oForm.DataSources.UserDataSources.Add("txH", SAPbouiCOM.BoDataType.dt_SHORT_TEXT); // Days of Month txH.DataBind.SetBound(true, "", "txH"); oItemRef = oForm.Items.Item("txH"); oItem = oForm.Items.Add("btNI", SAPbouiCOM.BoFormItemTypes.it_BUTTON); oItem.Top = oItemRef.Top + oItemRef.Height + 2; oItem.Height = oItemRef.Height + 5; oItem.Left = oItemRef.Left; oItem.Width = 150; oItem.FromPane = 101; oItem.ToPane = 101; oItem.LinkTo = "cbPM5"; btNI = (SAPbouiCOM.Button)oItem.Specific; btNI.Caption = "Add New Item"; } catch (Exception ex) { string message = ex.Message; } try { fillPrs(); } catch { } oForm.Freeze(false); dsWEB = new DataServices(Program.strExtCon); }