コード例 #1
0
        public string GetSlpcodeFromUserId(string userId) //user id si verilince slpcodu nu geri veriyor
        {
            HelperRecordset hrs = new HelperRecordset();
            string sql = string.Format("select ohem.SalesPrson as SlpCode from ousr inner join ohem on ousr.USERID=ohem.userId where OUSR.USERID='{0}'", userId);
            var oRecordSet = hrs.GetRecordSet();
            oRecordSet.DoQuery(sql);

            var slpCode = hrs.ReadRecordSetData(oRecordSet, "SlpCode");

            return slpCode;
        }
コード例 #2
0
        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();
                }
            }
        }
コード例 #3
0
        public string GetCurrentBranchId() //Seçilmiş şube idsi geri veriyor
        {
            SAPbouiCOM.Form _MenuForm = SAPbouiCOM.Framework.Application.SBO_Application.Forms.GetForm("169", 0);
            SAPbouiCOM.StaticText _Text = (SAPbouiCOM.StaticText)_MenuForm.Items.Item("7").Specific;
            string _Caption = _Text.Caption;
            string[] strBranch;
            string _CurrentBranch;
            strBranch = _Caption.Split(':');
            _CurrentBranch = strBranch[1].Trim();

            HelperRecordset hrs = new HelperRecordset();
            string sql = string.Format("select BPLId from OBPL where BPLName like N'%{0}%'", _CurrentBranch);
            var oRecordSet = hrs.GetRecordSet();
            oRecordSet.DoQuery(sql);

            var BPLId = hrs.ReadRecordSetData(oRecordSet, "BPLId");

            return BPLId;
        }
コード例 #4
0
        public bool SearchRecordset(SAPbobsCOM.Recordset oRecordSet, string field, string value)
        {
            HelperRecordset hrs = new HelperRecordset();

            if (oRecordSet.RecordCount != 0)
            {
                oRecordSet.MoveFirst();
                for (int i = 0; i < oRecordSet.RecordCount; i++)
                {
                    var val = oRecordSet.Fields.Item(field).Value.ToString();
                    if (val.Trim() == value.Trim())
                    {
                        return true;
                    }

                    oRecordSet.MoveNext();
                }

                return false;
            }
            else
                return false;
        }