Beispiel #1
1
        public static void AddAvarias(int idOOPR, string descricao, SAPbobsCOM.Company oCompany, SAPbouiCOM.Application SBO_Application)
        {
            SAPbobsCOM.GeneralService oGeneralService = null;
            SAPbobsCOM.GeneralData oGeneralData = null;
            SAPbobsCOM.GeneralDataParams oGeneralParams = null;
            SAPbobsCOM.CompanyService oCompanyService = null;
            string proxCode = GetProxCodeAvarias(oCompany);

            try
            {
                oCompanyService = oCompany.GetCompanyService();
                oGeneralService = oCompanyService.GetGeneralService("FLX_FB_AVR");
                oGeneralData = ((SAPbobsCOM.GeneralData)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData)));
                oGeneralData.SetProperty("Code", proxCode);
                oGeneralData.SetProperty("Name", proxCode);
                oGeneralData.SetProperty("U_FLX_FB_AVR_IDOOPR", idOOPR);
                oGeneralData.SetProperty("U_FLX_FB_AVR_DESC", descricao);

                oGeneralParams = oGeneralService.Add(oGeneralData);
            }
            catch (Exception ex)
            {
                SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
            }
        }
Beispiel #2
1
 public EventDispatcher(SAPbouiCOM.Application sapApp, MenuEventHandler menuHandler,
     AddinAppEventHandler addinAppEventHandler)
 {
     this.sapApp = sapApp;
     this.menuHandler = menuHandler;
     this.addinAppEventHandler = addinAppEventHandler;
 }
Beispiel #3
0
 public void FormInit(SAPbouiCOM.Form oForm)
 {
     oForm = B1Connections.theAppl.Forms.Item(formuid);
     oForm.Freeze(true);
     this.Act1_FormInit();
     oForm.Freeze(false);
 }
 public override void MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
 {
     BubbleEvent = true;
     this.UIAPIRawForm.Freeze(true);
     try
     {
         if (pVal.MenuUID == "AddLine")
         {
             if (this.UIAPIRawForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE || this.UIAPIRawForm.Mode == SAPbouiCOM.BoFormMode.fm_OK_MODE ||
                 this.UIAPIRawForm.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE)
             {
                 mtxCost.AddLine();
                 //mtxCost.AddRowIndex();
                 mtxCost.FlushToDataSource();
             }
         }
         if (pVal.MenuUID == "DeleteLine")
         {
             if (RowToDeleteIndex > 0)
             {
                 mtxCost.DeleteRow(RowToDeleteIndex);
                 mtxCost.FlushToDataSource();
                 this.UIAPIRawForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
             }
         }
     }
     catch (Exception ex)
     {
         Utilities.LogException(ex);
     }
     finally
     {
         this.UIAPIRawForm.Freeze(false);
     }
 }
Beispiel #5
0
        public CryptoService(SAPbouiCOM.Application app)
        {
            string _systemNumer = app.Company.SystemId.Trim();
            string _instalationNumber = app.Company.InstallationId.Trim();

            ENCRYPTION_KEY = _systemNumer + _instalationNumber;
        }
Beispiel #6
0
 public FormEventHandler(SAPbouiCOM.Application sapApp, PermissionManager permissionManager,
     B1SResourceManager resourceManager)
 {
     this.sapApp = sapApp;
     this.permissionManager = permissionManager;
     this.resourceManager = resourceManager;
 }
Beispiel #7
0
        //[B1Listener(BoEventTypes.et_MENU_CLICK, true, ActionType.Mnu)]
        //public virtual bool ET_BFMenuClick(MenuEvent pVal)
        //{
        //    // ADD YOUR ACTION CODE HERE ...
        //    return true;
        //}

        //[B1Listener(BoEventTypes.et_MENU_CLICK, false, ActionType.Mnu)]
        //public virtual void ET_OnAfterMenuClick(MenuEvent pVal)
        //{
        //    oForm.Freeze(true);
        //    this.Act1_FormInit(oForm);
        //    oForm.Freeze(false);
        //    // ADD YOUR ACTION CODE HERE ...
        //}

        /// <summary>
        /// 화면 팝업에 필요한 설정정보를 호출합니다.
        /// </summary>
        private void Act1_FormInit(SAPbouiCOM.Form oForm)
        {
            // '// ADD YOUR ACTION CODE HERE ...
            this.Act2_DataSourcesBinding();
            this.Act3_DefualtSetting(oForm);
            this.Act4_FormMenuSetting();
        }
Beispiel #8
0
        /// <summary>
        /// 체크된 행의 그리드 컬럼 합계를 계산하고 요청한 컬럼의 행 합계를 반환합니다.
        /// </summary>
        public static double GetGridCalc_SumValue(ref SAPbouiCOM.Form oForm, string ColumUid)
        {
            try
            {
                SAPbouiCOM.Grid oGrid = oForm.Items.Item("grd1").Specific;

                XDocument root = XDocument.Parse(oGrid.DataTable.SerializeAsXML(BoDataTableXmlSelect.dxs_DataOnly));


                var query =
                           from
                               c in root.Descendants("Row")
                           where c.Elements("Cells").Elements("Cell").Any(o => o.Element("ColumnUid").Value == "U_CHK" && o.Element("Value").Value == "Y")
                           select c;


                //금액 집계
                double U_DEPAMT = GetCoumnValue(query, ColumUid).Sum();//총 입금액


                oGrid = null;

                return U_DEPAMT;

            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #9
0
        /// <summary>
        /// 그리드의 컬럼 합계를 조작합니다.
        /// </summary>
        /// <param name="oGrid"></param>
        /// <param name="columnNames"></param>
        /// <param name="bst_Value"></param>
        internal static void SetGridSumField(ref SAPbouiCOM.Grid oGrid, string columnNames, BoColumnSumType bst_Value = BoColumnSumType.bst_Auto)
        {
            string[] columnName;
            SAPbouiCOM.GridColumn oGC = null;
            SAPbouiCOM.EditTextColumn oEditGC = null;

            try
            {
                columnName = columnNames.Split(',');
                for (int iLooper = 0; iLooper <= (columnName.Length - 1); iLooper++)
                {
                    oGC = oGrid.Columns.Item(columnName[iLooper].Trim());
                    oGC.Type = SAPbouiCOM.BoGridColumnType.gct_EditText;
                    oEditGC = (SAPbouiCOM.EditTextColumn)oGC;


                    oEditGC.ColumnSetting.SumType = bst_Value;



                }

            }
            catch (System.Exception ex)
            {
                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
            finally
            {
                oGC = null;
                oEditGC = null;
                columnName = null;
            }
        }
        public void FillComboBox(SAPbouiCOM.ComboBox cb, List<ComboEntity> datasource)
        {
            foreach (var item in datasource)
            {
                cb.ValidValues.Add(item.Value, item.Description);
            }

        }
Beispiel #11
0
 internal static SAPbouiCOM.Form GetFormAfterAction(string formType, SAPbouiCOM.Application application, Action invoke)
 {
     int beforeCount = GetFormTypeCount(formType, application);
     invoke();
     int afterCount = GetFormTypeCount(formType, application);
     Assert.AreNotSame(beforeCount, afterCount);
     return application.Forms.GetForm(formType, beforeCount);
 }
 void btnAddRow_ClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     mtxCost.AddLine();
     //mtxCost.AddRowIndex();
     mtxCost.AddRowIndex();
     mtxCost.FlushToDataSource();
     this.UIAPIRawForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
 }
Beispiel #13
0
 private void A01_FormInit(SAPbouiCOM.Form oForm)
 {
     //'Initialize.....
     //DataBinded(ref oForm);
     //Call LabelInit(oForm)
     //Form_Default(oForm);
     //MenuSetting(ref oForm);
     //FindData(false)
 }
Beispiel #14
0
 private void Act1_FormInit(SAPbouiCOM.Form oForm)
 {
     oForm.Freeze(true);
     Act2_DataSourcesBinding(oForm);
     //Call LabelInit(oForm)
     Act3_DefualtSetting(oForm, "", "");
     Act4_FormMenuSetting(oForm);
     //FindData(false)
     oForm.Freeze(false);
 }
Beispiel #15
0
 internal static int GetFormTypeCount(string formType, SAPbouiCOM.Application application)
 {
     int count = 1;
     for (int i = 0; i < application.Forms.Count; i++)
     {
         if (application.Forms.Item(i).TypeEx == formType)
             count++;
     }
     return count;
 }
        public void SetComboBoxValue(SAPbouiCOM.ComboBox cb, string value) //combobox a değer set et
        {
            try
            {
                cb.Select(value);
            }
            catch
            {

            }
        }
 public override void MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
 {
     BubbleEvent = true;
     if (pVal.MenuUID == "DeleteLine")
     {
         if (RowToDeleteIndex > 0)
         {
             this.UIAPIRawForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE;
         }
     }
 }
Beispiel #18
0
 /// <summary>
 /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
 /// </summary>
 private void Act3_DefualtSetting(SAPbouiCOM.Form oForm)
 {
     // '// ADD YOUR ACTION CODE HERE ...
     try
     {
         CreateItem(oForm);
     }
     catch (Exception ex)
     {
         B1Connections.theAppl.StatusBar.SetText("Act3_DefualtSetting : " + ex.ToString(), SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
     }
 }
Beispiel #19
0
        public static void TransferItemsProcess(SAPbouiCOM.Application oApp, string referenceNumber, List<SelectedBatchDataSources> issueBatchDSList, List<SelectedBatchDataSources> receiptBatchDSList, List<TransferItem> issueItemsList, List<TransferItem> receiptItemsList)
        {
            try
            {
                B1Helper.DiCompany.StartTransaction();

                Task t1 = Task.Run(delegate()
                 {
                     foreach (var tItem in issueItemsList)
                     {
                         B1Helper.CreateTransferGoodsIssue(oApp, referenceNumber, tItem.IssueItemCode, Convert.ToDouble(tItem.Quantity), tItem.FromWhs);
                     }
                 });

                Task t2 = Task.Run(delegate()
                         {
                             foreach (var ds in issueBatchDSList)
                             {
                                 B1Helper.CreateTransferGoodsIssue(oApp, referenceNumber, ds.ItemCode, Convert.ToDouble(ds.Quantity), ds.WhsCode, ds.SelectedBatches);
                             }
                         });

                Task t3 = Task.Run(delegate()
                        {
                            foreach (var ds in receiptBatchDSList)
                            {
                                B1Helper.CreateTransferGoodsReceipt(oApp, referenceNumber, ds.ItemCode, Convert.ToDouble(ds.Quantity), ds.WhsCode, (ds.AddAmount/ds.Quantity) + ds.AvgPrice, ds.SelectedBatches);
                            }
                        });
                Task t4 = Task.Run(delegate()
               {
                   foreach (var receiptItem in receiptItemsList)
                   {
                       B1Helper.CreateTransferGoodsReceipt(oApp, referenceNumber, receiptItem.ReceiptItemCode, Convert.ToDouble(receiptItem.Quantity), receiptItem.ToWhs, receiptItem.AvgCost + (receiptItem.AddCost / receiptItem.Quantity));
                   }
               });

                Task.WaitAll(t1, t2, t3, t4);
                B1Helper.DiCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit);
            }
            catch (Exception ex)
            {
                var id = Convert.ToInt32(referenceNumber);
                Utilities.LogException(ex);
                B1Helper.DeleteRecord(id);
                B1Helper.DiCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack);
            }
        }
        public string GetTextValue(SAPbouiCOM.Form oForm, string uniqId) //textbox ın değerini alır
        {
            string val = "";
            try
            {
                val = ((SAPbouiCOM.EditText)oForm.Items.Item(uniqId).Specific).Value;

                
            }
            catch 
            {
                
                
            }
            return val;
        }
        public void FillComboBox(SAPbouiCOM.ComboBox cmbbox, string sql) //combo doldur
        {
            HelperRecordset hrs = new HelperRecordset();

            var oRecordSet = hrs.GetRecordSet();
            oRecordSet.DoQuery(sql);
            cmbbox.ValidValues.Add("", "");
            if (oRecordSet.RecordCount != 0)
            {
                oRecordSet.MoveFirst();
                for (int i = 0; i < oRecordSet.RecordCount; i++)
                {
                    cmbbox.ValidValues.Add(hrs.ReadRecordSetData(oRecordSet, "Description"), hrs.ReadRecordSetData(oRecordSet, "Value"));
                    oRecordSet.MoveNext();
                }
            }
        }
        public void SBO_Application_MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
        {
            BubbleEvent = true;

            try
            {
                if (pVal.BeforeAction && pVal.MenuUID == "LandedCost_Controls.Form1")
                {
                    Form1 activeForm = new Form1();
                    activeForm.Show();
                }
            }
            catch (Exception ex)
            {
                Application.SBO_Application.MessageBox(ex.ToString(), 1, "Ok", "", "");
            }
        }
Beispiel #23
0
 static void SBO_Application_AppEvent(SAPbouiCOM.BoAppEventTypes EventType)
 {
     switch (EventType)
     {
         case SAPbouiCOM.BoAppEventTypes.aet_ShutDown:
             //Exit Add-On
             System.Windows.Forms.Application.Exit();
             break;
         case SAPbouiCOM.BoAppEventTypes.aet_CompanyChanged:
             break;
         case SAPbouiCOM.BoAppEventTypes.aet_FontChanged:
             break;
         case SAPbouiCOM.BoAppEventTypes.aet_LanguageChanged:
             break;
         case SAPbouiCOM.BoAppEventTypes.aet_ServerTerminition:
             break;
         default:
             break;
     }
 }
Beispiel #24
0
        public static void UpdateAvarias(string code, string name, int idOOPR, string descricao, SAPbobsCOM.Company oCompany, SAPbouiCOM.Application SBO_Application)
        {
            SAPbobsCOM.GeneralService oGeneralService = null;
            SAPbobsCOM.GeneralData oGeneralData = null;
            SAPbobsCOM.CompanyService oCompanyService = null;

            try
            {
                oCompanyService = oCompany.GetCompanyService();
                oGeneralService = oCompanyService.GetGeneralService("FLX_FB_AVR");
                oGeneralData = ((SAPbobsCOM.GeneralData)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralData)));
                oGeneralData.SetProperty("Code", code);
                oGeneralData.SetProperty("Name", name);
                oGeneralData.SetProperty("U_FLX_FB_AVR_IDOOPR", idOOPR);
                oGeneralData.SetProperty("U_FLX_FB_AVR_DESC", descricao);

                oGeneralService.Update(oGeneralData);
            }
            catch (Exception ex)
            {
                SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
            }
        }
Beispiel #25
0
 private void EditText2_ValidateBefore(object sboObject, SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent)
 {
     BubbleEvent = true;
     throw new System.NotImplementedException();
 }
Beispiel #26
0
 private void EditText2_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     throw new System.NotImplementedException();
 }
Beispiel #27
0
        /// <summary>
        /// 폼(Form) 및 아이템들(Items)의 기본값으로 설정되야하는 항목들을 정의합니다.
        /// </summary>
        private void Act03_DefualtSetting(SAPbouiCOM.Form oForm, string pStrPFormUID)
        {
            try
            {
                //메트릭스 첫줄 선택시 팝업박스 뜨는것 막는다.
                oForm.Settings.EnableRowFormat = false;
                // UDO, 네비게이션 사용하지 않음
                oForm.SupportedModes = 1;

                // 메트릭스 설정
                oGrid = (SAPbouiCOM.Grid)oForm.Items.Item("grd").Specific;
                oGrid.SelectionMode = BoMatrixSelect.ms_Auto;

                // 부모창 ID 저장
                oForm.DataSources.UserDataSources.Item("pFORMUID").Value = pStrPFormUID;

                // 부보창에 현재창 ID 저장
                pForm = B1Connections.theAppl.Forms.Item(pStrPFormUID);
                pForm.DataSources.UserDataSources.Item("cFORMUID").Value = oForm.UniqueID;

                oForm.DataSources.DataTables.Add("grd");
                FindData(oForm);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #28
0
        /// <summary>
        /// 폼(Form)의 아이템들(Items)에 연결이 필요한 데이타소스(DataSource) 형식을 정의합니다.
        /// </summary>
        private void Act02_DataSourcesBinding(SAPbouiCOM.Form oForm)
        {
            // '// ADD YOUR ACTION CODE HERE ...
            oForm.DataSources.UserDataSources.Add("pFORMUID", BoDataType.dt_SHORT_TEXT, 254); //부모창UID
            oForm.DataSources.UserDataSources.Add("cFORMUID", BoDataType.dt_SHORT_TEXT, 254); //자식창UID

        }
Beispiel #29
0
        /// <summary>
        /// 요청된 사용자 정의 문서롤 오픈합니다.
        /// </summary>
        /// <param name="oForm"></param>
        /// <param name="ObjectType"></param>
        /// <param name="DocEntry"></param>
        internal void LoadSubForm(SAPbouiCOM.Form oForm, string ObjectType, string DocEntry = "")
        {
            try
            {
                switch (ObjectType)
                {
                    case "KIS_SD0080_HRD":
                        using (KIS_HRD.KIS_SD0080A_HRD KIS_SD0080A_HRD = new KIS_HRD.KIS_SD0080A_HRD())
                        {
                            KIS_SD0080A_HRD.SubFormInit(DocEntry);
                        }
                        break;

                    default:
                        break;
                }

            }
            catch (Exception ex)
            {

                B1Connections.theAppl.StatusBar.SetText(ex.Message, BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Error);
            }
        }
        public void SelectComboBoxValue(SAPbouiCOM.Form oForm, SAPbobsCOM.Recordset oRecordSet, string uniqId, string field) //combobox a değer set et
        {
            try
            {
                string val = oRecordSet.Fields.Item(field).Value.ToString();
                ((SAPbouiCOM.ComboBox)oForm.Items.Item(uniqId).Specific).Select(val);
            }
            catch
            {

            }
        }