private void addItem() { string itemCode = txItCode.Value.ToString(); int cntExist = Convert.ToInt32(Program.objHrmsUI.getScallerValue("Select count(*) from oitm where ItemCode = '" + itemCode + "'")); if (cntExist == 0) { SAPbobsCOM.Items newRetItem; newRetItem = (SAPbobsCOM.Items)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems); newRetItem.ItemCode = itemCode; newRetItem.ItemName = txName.Value.ToString(); newRetItem.ItemsGroupCode = Convert.ToInt16(cbIG.Selected.Value.ToString()); newRetItem.SalesUnitLength = txL.Value != "" ? Convert.ToDouble(txL.Value) : 0.00; newRetItem.SalesUnitWidth = txW.Value != "" ? Convert.ToDouble(txW.Value) : 0.00; newRetItem.SalesUnitHeight = txH.Value != "" ? Convert.ToDouble(txH.Value) : 0.00; newRetItem.UserFields.Fields.Item("U_PARAM1").Value = cbPM1.Value.ToString(); newRetItem.UserFields.Fields.Item("U_PARAM2").Value = cbPM2.Value.ToString(); newRetItem.UserFields.Fields.Item("U_PARAM3").Value = cbPM3.Checked == true ? "Y" : "N"; newRetItem.UserFields.Fields.Item("U_PARAM4").Value = cbPM4.Checked == true ? "Y":"N"; newRetItem.UserFields.Fields.Item("U_PARAM5").Value = cbPM5.Checked == true?"Y":"N"; newRetItem.UserFields.Fields.Item("U_PARAM6").Value = cbPM6.Checked == true ? "Y" : "N"; newRetItem.UserFields.Fields.Item("U_PARAM7").Value = cbPM7.Value.ToString(); newRetItem.UserFields.Fields.Item("U_PARAM8").Value = cbPM8.Checked == true ? "Y" : "N"; int result = newRetItem.Add(); if (result == 0) { oApplication.SetStatusBarMessage("Item " + itemCode + " Added Successfully", BoMessageTime.bmt_Short, false); txName.Value = ""; SAPbouiCOM.EditText newItemCode = (SAPbouiCOM.EditText)mtItems.Columns.Item("1").Cells.Item(mtItems.RowCount).Specific; SAPbouiCOM.Folder general = (SAPbouiCOM.Folder)oForm.Items.Item("112").Specific; general.Select(); oForm.PaneLevel = 1; newItemCode.Value = itemCode; // txName.Active = true; } else { int erroCode = 0; string errDescr = ""; string Errmsg = ""; oCompany.GetLastError(out erroCode, out errDescr); oApplication.SetStatusBarMessage("Item " + itemCode + " Failed to import: " + errDescr, BoMessageTime.bmt_Short, true); } } }
private void OApplication_ItemEvent(string FormUID, ref ItemEvent pVal, out bool BubbleEvent) { BubbleEvent = true; if ( (pVal.FormType == 139) & pVal.EventType != BoEventTypes.et_FORM_UNLOAD & pVal.BeforeAction ) { this.oFormPV = oApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount); if (pVal.EventType == BoEventTypes.et_FORM_LOAD & pVal.BeforeAction) { oNewItem = this.oFormPV.Items.Add("UserFolder", BoFormItemTypes.it_FOLDER); oItem = this.oFormPV.Items.Item("138"); oNewItem.Top = oItem.Top; oNewItem.Height = oItem.Height; oNewItem.Width = oItem.Width; oNewItem.Left = oItem.Left; oFolderItem = (SAPbouiCOM.Folder)oNewItem.Specific; oFolderItem.Caption = "User Folder"; oFolderItem.GroupWith("138"); AddItemsToPVForm(); this.oFormPV.PaneLevel = 1; } if ( pVal.ItemUID.Equals("UserFolder") & pVal.EventType == BoEventTypes.et_ITEM_PRESSED & pVal.BeforeAction ) { this.oFormPV.PaneLevel = 5; } } }
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; }
public virtual void ET_fld2_AFItemPressed(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oFolder = ((SAPbouiCOM.Folder)(oForm.Items.Item("fld2").Specific)); // ADD YOUR ACTION CODE HERE ... oForm.PaneLevel = 2; }
private void ClearUnManagedObject() { if ( oFolder != null ) { Marshal.ReleaseComObject(oFolder); } oFolder = null; if (oEditText != null) { Marshal.ReleaseComObject(oEditText); } oEditText = null; if (oButton != null) { Marshal.ReleaseComObject(oButton); } oButton = null; if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null; if ((oForm != null)) { Marshal.ReleaseComObject(oForm); } oForm = null; if ((oGrid1 != null)) { Marshal.ReleaseComObject(oGrid1); } oForm = null; if ((oGrid2 != null)) { Marshal.ReleaseComObject(oGrid2); } oForm = null; if ((oGrid3 != null)) { Marshal.ReleaseComObject(oGrid3); } oForm = null; if ((oGrid4 != null)) { Marshal.ReleaseComObject(oGrid4); } oForm = null; if ((oRS != null)) { Marshal.ReleaseComObject(oRS); } oForm = null; // ADD YOUR ACTION CODE HERE ... System.GC.Collect(); System.GC.WaitForPendingFinalizers(); GRIDCODE = ""; }
private void ClearUnManagedObject() { if (oFolder != null) { Marshal.ReleaseComObject(oFolder); } oFolder = null; if (oComboBox != null) { Marshal.ReleaseComObject(oComboBox); } oComboBox = null; if (oOptionBtn != null) { Marshal.ReleaseComObject(oOptionBtn); } oOptionBtn = null; if (oGrid != null) { Marshal.ReleaseComObject(oGrid); } oGrid = null; if (oRS != null) { Marshal.ReleaseComObject(oRS); } oRS = 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 (oForm != null) { Marshal.ReleaseComObject(oForm); } oForm = null; // ADD YOUR ACTION CODE HERE ... System.GC.Collect(); System.GC.WaitForPendingFinalizers(); }
public virtual void ET_fld03_AFItemPressed(ItemEvent pVal) { oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID); oFolder = ((SAPbouiCOM.Folder)(oForm.Items.Item("fld03").Specific)); // ADD YOUR ACTION CODE HERE ... //SetGridTitleByTab(oForm); }
private void btnPayments_ClickBefore(object sboObject, SBOItemEventArg pVal, out bool BubbleEvent) { BubbleEvent = true; Form lObjPaymentForm = null; Form lObjPaymentFormUDF = null; Form lObjAccountForm = null; try { if (mIntRowSelected > 0) { StatusEnum lEnmStatus = (StatusEnum)int.Parse(DtMatrix.GetValue("C_Status", mIntRowSelected - 1).ToString()); string lStrFolio = DtMatrix.GetValue("C_Folio", mIntRowSelected - 1).ToString(); string lStrEmpCode = DtMatrix.GetValue("C_Employe", mIntRowSelected - 1).ToString(); string lStrArea = DtMatrix.GetValue("C_Area", mIntRowSelected - 1).ToString(); double lDblImport = double.Parse(DtMatrix.GetValue("C_Amount", mIntRowSelected - 1).ToString()); string lStrEmpName = mObjPurchasesServiceFactory.GetPurchaseService().GetEmpName(lStrEmpCode); string lStrLineAccount = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetAccountRefund(lStrArea); //string lStrChkAcct = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetAccountInConfig("GLO_CTAREEMBCHEQ"); string lStrChkAcct = cbAccount.Value; // Dictionary<string, string> lStrBankInfo = mObjPurchasesServiceFactory.GetPurchaseReceiptsService().GetBankInfo(lStrChkAcct); Dictionary <string, string> lStrBankInfo = new Dictionary <string, string>(); lStrBankInfo.Add(cbAccount.Value, cbBank.Selected.Description); if (lEnmStatus != StatusEnum.Authorized_Ope_Admon) { UIApplication.ShowError("El reembolso seleccionado no está autorizado"); return; } string lStrValidation = ValidatePaymentsFields(lStrFolio, lStrEmpCode, lStrArea, lDblImport, lStrChkAcct, lStrBankInfo, lStrLineAccount); if (!string.IsNullOrEmpty(lStrValidation)) { UIApplication.ShowMessageBox(lStrValidation); return; } if (mObjPurchasesServiceFactory.GetPurchaseReceiptsService().ExistsPayment(lStrEmpCode, lStrFolio, lStrArea)) /*string lStrDocEntry = DtMatrix.GetValue("C_DocEntry", mIntRowSelected - 1).ToString(); * if (mObjPurchasesServiceFactory.GetPurchaseReceiptsService().ExistsPayment(lStrDocEntry))*/ { UIApplication.ShowError("Ya existe un pago para el reembolso seleccionado"); return; } this.UIAPIRawForm.Freeze(true); UIApplication.GetApplication().ActivateMenuItem("2818"); if (!UIApplication.GetApplication().Menus.Item("6913").Checked) { UIApplication.GetApplication().ActivateMenuItem("6913");//2050 } lObjPaymentForm = UIApplication.GetApplication().Forms.GetForm("426", -1); lObjPaymentFormUDF = UIApplication.GetApplication().Forms.GetForm("-426", -1); lObjPaymentForm.Freeze(true); lObjPaymentFormUDF.Freeze(true); SAPbouiCOM.EditText txtDocDate = ((SAPbouiCOM.EditText)lObjPaymentForm.Items.Item("10").Specific); txtDocDate.Value = DateTime.Now.ToString("yyyyMMdd"); SAPbouiCOM.OptionBtn optionBtnAccount = ((SAPbouiCOM.OptionBtn)lObjPaymentForm.Items.Item("58").Specific); optionBtnAccount.Selected = true; SAPbouiCOM.ComboBox cboPymtType = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_GLO_PaymentType").Specific); cboPymtType.Select("GLREM", SAPbouiCOM.BoSearchKey.psk_ByValue); SAPbouiCOM.EditText txtCodeMov = ((SAPbouiCOM.EditText)lObjPaymentFormUDF.Items.Item("U_GLO_CodeMov").Specific); txtCodeMov.Value = lStrFolio; SAPbouiCOM.ComboBox txtCostCenter = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_GLO_CostCenter").Specific); txtCostCenter.Select(lStrArea, SAPbouiCOM.BoSearchKey.psk_ByValue); SAPbouiCOM.ComboBox cboAuxiliarType = ((SAPbouiCOM.ComboBox)lObjPaymentFormUDF.Items.Item("U_FZ_AuxiliarType").Specific); cboAuxiliarType.Select("2", SAPbouiCOM.BoSearchKey.psk_ByValue); SAPbouiCOM.EditText txtName = ((SAPbouiCOM.EditText)lObjPaymentForm.Items.Item("10000166").Specific); txtName.Value = lStrEmpName; SAPbouiCOM.EditText txtAuxiliar = ((SAPbouiCOM.EditText)lObjPaymentFormUDF.Items.Item("U_FZ_Auxiliar").Specific); txtAuxiliar.Value = lStrEmpCode; SAPbouiCOM.Button btnBank = ((SAPbouiCOM.Button)lObjPaymentForm.Items.Item("234000001").Specific); btnBank.Item.Click(); lObjAccountForm = UIApplication.GetApplication().Forms.GetForm("196", -1); lObjAccountForm.Freeze(true); SAPbouiCOM.Folder folderCheck = ((SAPbouiCOM.Folder)lObjAccountForm.Items.Item("3").Specific); folderCheck.Item.Click(); SAPbouiCOM.Matrix mtxCheck = ((SAPbouiCOM.Matrix)lObjAccountForm.Items.Item("28").Specific); ((SAPbouiCOM.EditText)mtxCheck.Columns.Item("7").Cells.Item(1).Specific).Value = lDblImport.ToString(); ComboBox cb = ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("2").Cells.Item(1).Specific); string ss = lStrBankInfo[lStrBankInfo.Keys.ElementAt(0)]; //lStrBankInfo.ElementAt(0); ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("2").Cells.Item(1).Specific).Select(lStrBankInfo[lStrBankInfo.Keys.ElementAt(0)], SAPbouiCOM.BoSearchKey.psk_ByValue); //Banco ((SAPbouiCOM.ComboBox)mtxCheck.Columns.Item("4").Cells.Item(1).Specific).Select(lStrBankInfo.Keys.ElementAt(0), SAPbouiCOM.BoSearchKey.psk_ByValue); //Cuenta? SAPbouiCOM.Button btnOk = ((SAPbouiCOM.Button)lObjAccountForm.Items.Item("1").Specific); btnOk.Item.Click(); SAPbouiCOM.Matrix mtxPayment = ((SAPbouiCOM.Matrix)lObjPaymentForm.Items.Item("71").Specific); mtxPayment.AddRow(); ((SAPbouiCOM.EditText)mtxPayment.Columns.Item("5").Cells.Item(1).Specific).Value = lDblImport.ToString(); ((SAPbouiCOM.EditText)mtxPayment.Columns.Item("8").Cells.Item(1).Specific).Value = lStrLineAccount; //cuenta de mayor } else { UIApplication.ShowMessageBox("Favor de seleccionar un registro"); } lObjPaymentFormUDF.Freeze(false); this.UIAPIRawForm.Freeze(false); if (lObjPaymentForm != null) { lObjPaymentForm.Freeze(false); } if (lObjAccountForm != null) { lObjPaymentFormUDF.Freeze(false); } if (this.UIAPIRawForm != null) { this.UIAPIRawForm.Freeze(false); } // if (lObjAccountForm. ==) lObjAccountForm.Freeze(false); UIApplication.ShowSuccess("Carga de pago terminada"); } catch (Exception ex) { LogService.WriteError("frmSearchRefunds (btnPayments_ClickBefore) " + ex.Message); LogService.WriteError(ex); UIApplication.ShowMessageBox(string.Format("Error al abrir pantalla de pagos: {0}", ex.Message)); } finally { if (lObjPaymentFormUDF != null) { lObjPaymentFormUDF.Freeze(false); } this.UIAPIRawForm.Freeze(false); } }
private void InitiallizeForm() { oForm.Freeze(true); // Program.objHrmsUI.ExecQuery("Update B1_SCHMDT set u_upd='Y' where isnull(u_upd,'N') = 'N'", "Finalizing temp"); Program.objHrmsUI.ExecQuery("delete from [@B1_SCHMDT] where isnull(u_upd,'N') = 'N'", "Finalizing temp"); Program.objHrmsUI.ExecQuery("delete from [@B1_SCHMDY] where isnull(u_upd,'N') = 'N'", "Finalizing temp"); Program.objHrmsUI.ExecQuery("delete from [@B1_SO] where isnull(u_upd,'N') = 'N'", "Finalizing temp"); Program.objHrmsUI.ExecQuery("delete from [@B1_SCHOT] where isnull(u_upd,'N') = 'N'", "Finalizing temp"); cardCFL = (SAPbouiCOM.ChooseFromList)oForm.ChooseFromLists.Item("cflCRD"); SAPbouiCOM.Conditions oCons = cardCFL.GetConditions(); SAPbouiCOM.Condition oCon = oCons.Add(); oCon.Alias = "CardType"; oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL; oCon.CondVal = "C"; cardCFL.SetConditions(oCons); dtHead = oForm.DataSources.DataTables.Item("dtHead"); dtItem = oForm.DataSources.DataTables.Item("dtItem"); dtDate = oForm.DataSources.DataTables.Item("dtDate"); dtDays = oForm.DataSources.DataTables.Item("dtDays"); dtOSCN = oForm.DataSources.DataTables.Item("dtOSCN"); dtOT = oForm.DataSources.DataTables.Item("dtOT"); mtItem = (SAPbouiCOM.Matrix)oForm.Items.Item("mtItem").Specific; mtDate = (SAPbouiCOM.Matrix)oForm.Items.Item("mtDate").Specific; mtDay = (SAPbouiCOM.Matrix)oForm.Items.Item("mtDays").Specific; mtOSCN = (SAPbouiCOM.Matrix)oForm.Items.Item("mtOSCN").Specific; mtOT = (SAPbouiCOM.Matrix)oForm.Items.Item("mtOT").Specific; dtHead.Rows.Add(1); dtHead.SetValue("tsActive", 0, "Y"); txCode = (SAPbouiCOM.EditText)oForm.Items.Item("txCode").Specific; txName = (SAPbouiCOM.EditText)oForm.Items.Item("txName").Specific; txCT = (SAPbouiCOM.EditText)oForm.Items.Item("txCT").Specific; txOTDT = (SAPbouiCOM.EditText)oForm.Items.Item("txOTDT").Specific; txICode = (SAPbouiCOM.EditText)oForm.Items.Item("txICode").Specific; txOMDT = (SAPbouiCOM.EditText)oForm.Items.Item("txOMDT").Specific; txOICODE = (SAPbouiCOM.EditText)oForm.Items.Item("txOICODE").Specific; imgImage = (SAPbouiCOM.PictureBox)oForm.Items.Item("imgImage").Specific; txSL = (SAPbouiCOM.EditText)oForm.Items.Item("txSL").Specific; cbSP = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbSP").Specific; cbDays = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbDays").Specific; cbWeeks = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbWeeks").Specific; cbHH = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbHH").Specific; cbMM = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbMM").Specific; cbAP = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbAP").Specific; cbEWN = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbEWN").Specific; cbOTHH = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOTHH").Specific; cbOTMM = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOTMM").Specific; cbOTAP = (SAPbouiCOM.ComboBox)oForm.Items.Item("cbOTAP").Specific; opOD = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opOD").Specific; opOW = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opOW").Specific; opOM = (SAPbouiCOM.OptionBtn)oForm.Items.Item("opOM").Specific; OMDY = (SAPbouiCOM.OptionBtn)oForm.Items.Item("OMDY").Specific; OMDT = (SAPbouiCOM.OptionBtn)oForm.Items.Item("OMDT").Specific; opOW.GroupWith("opOD"); opOM.GroupWith("opOD"); OMDY.GroupWith("OMDT"); opOD.Selected = true; OMDT.Selected = true; tbSO = (SAPbouiCOM.Folder)oForm.Items.Item("tbSO").Specific; tbTS = (SAPbouiCOM.Folder)oForm.Items.Item("tbTS").Specific; tbTS.Select(); fillCBs(); oForm.Freeze(false); txCode.Active = true; }
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); }