コード例 #1
0
ファイル: AlarmBirth.cs プロジェクト: step4u/MiniCRM
        public AlarmBirths()
        {
            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn))
            {
                DataTable dt = util.MakeDataTable2Proc();

                DataRow dr = dt.NewRow();
                dr["DataName"] = "@i_com_idx";
                dr["DataValue"] = util.Userinfo.COM_IDX;
                dt.Rows.Add(dr);

                try
                {
                    dt = db.GetDataTableSP("GET_ALARM_BIRTH", dt);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    throw fe;
                }

                _obslist = new ObservableCollection<AlarmBirth>(
                                    (from myRow in dt.AsEnumerable()
                                     select new AlarmBirth()
                                     {
                                         Idx = myRow["o_idx"].ToString()
                                         , Name = myRow["o_name"].ToString()
                                         , Birth = myRow["o_birth"].ToString()
                                         , Birth_Luna = myRow["o_birth_luna"].ToString()
                                         , Cstg_Name = myRow["o_cstg_name"].ToString()
                                         , Remain_Birth = myRow["o_remain_birth"].ToString()
                                     }).ToList<AlarmBirth>());
            }
        }
コード例 #2
0
ファイル: AlarmAttention.cs プロジェクト: step4u/MiniCRM
        public AlarmAttentions()
        {
            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn))
            {
                DataTable dt = util.MakeDataTable2Proc();

                DataRow dr = dt.NewRow();
                dr["DataName"] = "@i_com_idx";
                dr["DataValue"] = util.Userinfo.COM_IDX;
                dt.Rows.Add(dr);

                try
                {
                    dt = db.GetDataTableSP("GET_ALARM_ATTENTION", dt);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    throw fe;
                }

                _obslist = new ObservableCollection<AlarmAttention>(
                                    (from myRow in dt.AsEnumerable()
                                     select new AlarmAttention()
                                     {
                                         Ch_Idx = myRow["o_ch_idx"].ToString()
                                         , Ch_Name = myRow["o_ch_name"].ToString()
                                         , Evt_Title = myRow["o_evt_title"].ToString()
                                         , Evt_Memo = myRow["o_evt_memo"].ToString()
                                         , Evt_Sdate = myRow["o_evt_sdate"].ToString()
                                     }).ToList<AlarmAttention>());
            }
        }
コード例 #3
0
ファイル: Interview.cs プロジェクト: step4u/MiniCRM
        public Interviewes(int _id, string _sdate, string _edate, string _txt2, string _txt3)
        {
            DataTable dt = util.CreateDT2SP();

            dt.Rows.Add("@iseq", _id);
            dt.Rows.Add("@isdate", _sdate);
            dt.Rows.Add("@iedate", _edate);
            dt.Rows.Add("@itxt2", _txt2);
            dt.Rows.Add("@itxt3", _txt3);

            using ( FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
            {
                try
                {
                    dt = db.GetDataTableSP("GET_INTERVIEWS", dt);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    //throw fe;
                }
            }

            _list = new ObservableCollection<Interview>(
                    (from __row in dt.AsEnumerable()
                     select new Interview()
                     {
                         seq = long.Parse(__row[0].ToString())
                         ,
                         fseq = int.Parse(string.IsNullOrEmpty(__row[1].ToString()) ? "0" : __row[1].ToString())
                         ,
                         forward = __row[2].ToString()
                         ,
                         extention = __row[3].ToString()
                         ,
                         peernum = __row[4].ToString()
                         ,
                         recfile = __row[5].ToString()
                         ,
                         regdate = DateTime.Parse(__row[6].ToString())
                         ,
                         regyymmdd = __row[7].ToString()
                         ,
                         reghhmmss = __row[8].ToString()
                         ,
                         fnlen = double.Parse(__row[9].ToString())
                         ,
                         tellername = __row[10].ToString()
                     }).ToList<Interview>()
                );
        }
コード例 #4
0
ファイル: Consultant.cs プロジェクト: step4u/MiniCRM
        public Consultants(string _chk, string _sdate, string _edate, string _teller)
        {
            DataTable dt = util.CreateDT2SP();

            dt.Rows.Add("@I_CHK", _chk);
            dt.Rows.Add("@I_SDATE", _sdate);
            dt.Rows.Add("@I_EDATE", _edate);
            dt.Rows.Add("@I_TELLER", _teller);

            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
            {
                try
                {
                    dt = db.GetDataTableSP("GET_LIST_BY_TELNUM", dt);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    //throw fe;
                }
            }

            _list = new ObservableCollection<Consultant>(
                    (from _row in dt.AsEnumerable()
                     select new Consultant()
                     {
                         telnum = _row["O_TELNUM"].ToString()
                         ,
                         tellername = _row["O_TELLERNAME"].ToString()
                         ,
                         calledsec = int.Parse(_row["O_CALLEDSEC"].ToString())
                         ,
                         callednum = int.Parse(_row["O_CALLEDNUM"].ToString())
                         ,
                         succeed = int.Parse(_row["O_SUCCEED"].ToString())
                         ,
                         absence = int.Parse(_row["O_ABSENCE"].ToString())
                         ,
                         failed = int.Parse(_row["O_FAILED"].ToString())
                         ,
                         avgcalledsec = int.Parse(_row["O_AVGCALLEDSEC"].ToString())
                     }).ToList<Consultant>()
                );
        }
コード例 #5
0
ファイル: FamilyRole.cs プロジェクト: step4u/MiniCRM
        public FamilyRoles()
        {
            DataTable dt = null;

            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn))
            {
                try
                {
                    dt = db.GetDataTableSP("GET_FAMILY_ROLE");
                }
                catch (System.Data.SqlClient.SqlException e)
                {
                    throw e;
                }
            }

            FamilyRole fr = new FamilyRole() {
                Fr_Idx = "0"
                , Fr_Name = util.LoadProjectResource("TEXT_CB_FIRSTFIELD", "COMMONRES", "").ToString()
                , Fr_Sort = "0"
                , Fr_Use = "1"
            };

            _roles.Add(fr);

            foreach (DataRow myRow in dt.Rows)
            {
                fr = new FamilyRole()
                {
                    Fr_Idx = myRow["o_fr_idx"].ToString()
                    ,
                    Fr_Name = myRow["o_fr_name"].ToString()
                    ,
                    Fr_Sort = myRow["o_fr_sort"].ToString()
                    ,
                    Fr_Use = myRow["o_fr_use"].ToString()
                };

                _roles.Add(fr);
            }
        }
コード例 #6
0
ファイル: CDRs.cs プロジェクト: step4u/MiniCRM
        public CDRLists(string _sdate, string _edate, string _gubun, string _teller)
        {
            DataTable dt = util.CreateDT2SP();

            dt.Rows.Add("@i_sdate", _sdate);
            dt.Rows.Add("@i_edate", _edate);
            dt.Rows.Add("@i_gubun", _gubun);
            dt.Rows.Add("@i_teller", _teller);

            using ( FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
            {
                try
                {
                    dt = db.GetDataTableSP("GET_CDR_LIST_BY_DATE2", dt);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    //throw fe;
                }
            }

            _list = new ObservableCollection<CDRs>(
                    (from _row in dt.AsEnumerable()
                     select new CDRs()
                     {
                         startdate = _row[2].ToString()
                         ,
                         enddate = _row[3].ToString()
                         ,
                         callernum = _row[5].ToString()
                         ,
                         callername = _row[9].ToString()
                         ,
                         calleenum = _row[10].ToString()
                     }).ToList<CDRs>()
                );
        }
コード例 #7
0
ファイル: Account.cs プロジェクト: step4u/MiniCRM
        public Accounts()
        {
            DataTable dt = util.CreateDT2SP();
            dt.Rows.Add("@I_ID", util.userid);

            try
            {
                using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
                {
                    try
                    {
                        DataTable _dt = db.GetDataTableSP("GET_USRS", dt);

                        _list = new ObservableCollection<Account>(
                                (from _row in _dt.AsEnumerable()
                                 select new Account()
                                 {
                                     ID = _row[0].ToString()
                                     ,
                                     NAME = _row[1].ToString()
                                 }
                                ).ToList<Account>()
                            );
                    }
                    catch (FirebirdSql.Data.FirebirdClient.FbException fe1)
                    {
                        //throw fe;
                    }
                }
            }
            catch (FirebirdSql.Data.FirebirdClient.FbException fe0)
            {
                _list = new ObservableCollection<Account>();
                MessageBox.Show("Database 접속에 문제가 발생하였습니다.\r\n \"도구 → 환경설정 → 서버주소\"을 확인 후 다시 실행해 주세요.");
            }

        }
コード例 #8
0
ファイル: StatisticRealStatus.cs プロジェクト: step4u/MiniCRM
        public RealStatusList(int _chk, string _sdate, string _edate)
        {
            DataTable dt = util.CreateDT2SP();
            dt.Rows.Add("@i_chk", _chk);
            dt.Rows.Add("@i_sdate", _sdate);
            dt.Rows.Add("@i_edate", _edate);

            try
            {
                using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
                {
                    try
                    {
                        dt = db.GetDataTableSP("GET_REALTIME_STATUS", dt);
                    }
                    catch (FirebirdSql.Data.FirebirdClient.FbException fe1)
                    {
                        //throw fe;
                    }
                }

                Items = new List<StatisticRealStatus>(
                        (from _row in dt.AsEnumerable()
                         select new StatisticRealStatus()
                         {
                             Label = _row[0].ToString()
                             ,
                             Value1 = int.Parse(_row[1].ToString())
                         }
                        )
                    );
            }
            catch (FirebirdSql.Data.FirebirdClient.FbException fe0)
            {
            }
        }
コード例 #9
0
ファイル: Calltime.cs プロジェクト: step4u/MiniCRM
        public Calltimes(string _chk, string _sdate, string _edate, string _teller)
        {
            DataTable dt_worktime = null;
            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
            {
                try
                {
                    dt_worktime = db.GetDataTableSP("GET_LIST_WORKTIME");
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    //throw fe;
                }
            }

            DataTable dt_cdrs = util.CreateDT2SP();
            dt_cdrs.Rows.Add("@I_SDATE", _sdate);
            dt_cdrs.Rows.Add("@I_EDATE", _edate);
            dt_cdrs.Rows.Add("@I_TELLER", _teller);

            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
            {
                try
                {
                    dt_cdrs = db.GetDataTableSP("GET_CDR_LIST_BY_DATE", dt_cdrs);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    //throw fe;
                }
            }

            var _cdrs = dt_cdrs.AsEnumerable().ToList();

#if true // foreach 사용
            _list = new List<CalltimePivot>();
            foreach (var wtime in dt_worktime.AsEnumerable())
            {
                var _lcdrs = _cdrs.Where(p => ((DateTime)p[3]).Hour == int.Parse(wtime[0].ToString()));
                //((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString())

                CalltimePivot _pivot = new CalltimePivot() {
                    timerange = wtime[1].ToString()
                        ,
                    totalnum = _lcdrs.Count(x => ((DateTime)x[4] - (DateTime)x[3]).TotalSeconds > 0)
                        ,
                    col30 = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 0 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 30)
                        ,
                    col60 = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 30 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 60)
                        ,
                    col180 = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 60 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 180)
                        ,
                    col300 = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 180 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 300)
                        ,
                    col600 = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 300 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 600)
                        ,
                    col1800 = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 600 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 1800)
                        ,
                    col3600 = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 1800 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 3600)
                        ,
                    colall = _lcdrs.Count(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 3600)
                        ,
                    colavg = _lcdrs.Count(x => ((DateTime)x[4] - (DateTime)x[3]).TotalSeconds > 0) == 0 ? 0 : (int)_lcdrs.Sum(x => ((DateTime)x[4] - (DateTime)x[3]).TotalSeconds) / _lcdrs.Count(x => ((DateTime)x[4] - (DateTime)x[3]).TotalSeconds > 0)
                };

                _list.Add(_pivot);
            }
#endif

#if false // lamda 사용
            _list = new List<CalltimePivot>(
                (from wtime in dt_worktime.AsEnumerable()
                    select new CalltimePivot()
                    {
                        timerange = wtime[1].ToString()
                        ,
                        totalnum = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && ((DateTime)x[4] - (DateTime)x[3]).TotalSeconds > 0)
                        ,
                        col30 = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 0 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 30)
                        ,
                        col60 = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 30 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 60)
                        ,
                        col180 = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 60 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 180)
                        ,
                        col300 = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 180 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 300)
                        ,
                        col600 = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 300 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 600)
                        ,
                        col1800 = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 600 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 1800)
                        ,
                        col3600 = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 1800 && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds <= 3600)
                        ,
                        colall = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds > 3600)
                        ,
                        colavg = _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && ((DateTime)x[4] - (DateTime)x[3]).TotalSeconds > 0) == 0 ? 0 : (int)_cdrs.Where(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString())).Sum(x => (((DateTime)x[4]) - ((DateTime)x[3])).TotalSeconds) / _cdrs.Count(x => ((DateTime)x[3]).Hour == int.Parse(wtime[0].ToString()) && ((DateTime)x[4] - (DateTime)x[3]).TotalSeconds > 0)
                    }).ToList<CalltimePivot>()
            );
#endif

/*
            List<CDR> _cdrs = new List<CDR>(
                (from cdrRow in dt_cdrs.AsEnumerable()
                 select new CDR() {
                     index = string.IsNullOrEmpty(cdrRow["IDX"].ToString()) ? 0 : int.Parse(cdrRow["IDX"].ToString())
                     ,
                     inner_fseq = string.IsNullOrEmpty(cdrRow["INNER_FSEQ"].ToString()) ? 0 : int.Parse(cdrRow["INNER_FSEQ"].ToString())
                     ,
                     office_name = cdrRow["OFFICE_NAME"].ToString()
                     ,
                     startdate = DateTime.Parse(cdrRow["STARTDATE"].ToString())
                     ,
                     enddate = DateTime.Parse(cdrRow["ENDDATE"].ToString())
                     ,
                     caller_type = string.IsNullOrEmpty(cdrRow["CALLER_TYPE"].ToString()) ? 0 : int.Parse(cdrRow["CALLER_TYPE"].ToString())
                     ,
                     caller = cdrRow["CALLER"].ToString()
                     ,
                     caller_ipn_number = cdrRow["CALLER_IPN_NUMBER"].ToString()
                     ,
                     caller_group_code = cdrRow["CALLER_GROUP_CODE"].ToString()
                     ,
                     caller_group_name = cdrRow["CALLER_GROUP_NAME"].ToString()
                     ,
                     caller_human_name = cdrRow["CALLER_HUMAN_NAME"].ToString()
                     ,
                     callee = cdrRow["CALLEE"].ToString()
                     ,
                     callee_type = string.IsNullOrEmpty(cdrRow["CALLEE_TYPE"].ToString()) ? 0 : int.Parse(cdrRow["CALLEE_TYPE"].ToString())
                     ,
                     callee_ipn_number = cdrRow["CALLEE_IPN_NUMBER"].ToString()
                     ,
                     callee_group_code = cdrRow["CALLEE_GROUP_CODE"].ToString()
                     ,
                     callee_group_name = cdrRow["CALLEE_GROUP_NAME"].ToString()
                     ,
                     callee_human_name = cdrRow["CALLEE_HUMAN_NAME"].ToString()
                     ,
                     result = string.IsNullOrEmpty(cdrRow["RESULT"].ToString()) ? -1 : int.Parse(cdrRow["RESULT"].ToString())
                     ,
                     seq = string.IsNullOrEmpty(cdrRow["SEQ"].ToString()) ? 0 : int.Parse(cdrRow["SEQ"].ToString())
                 }).ToList()
                );

            _list = new List<CalltimePivot>(
                    (from wtime in dt_worktime.AsEnumerable()
                     select new CalltimePivot()
                     {
                         timerange = wtime[1].ToString()
                         ,
                         totalnum = _cdrs.Count(x => x == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 0)
                         ,
                         col30 = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 0 && (x.enddate - x.startdate).TotalSeconds <= 30)
                         ,
                         col60 = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 30 && (x.enddate - x.startdate).TotalSeconds <= 60)
                         ,
                         col180 = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 60 && (x.enddate - x.startdate).TotalSeconds <= 180)
                         ,
                         col300 = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 180 && (x.enddate - x.startdate).TotalSeconds <= 300)
                         ,
                         col600 = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 300 && (x.enddate - x.startdate).TotalSeconds <= 600)
                         ,
                         col1800 = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 600 && (x.enddate - x.startdate).TotalSeconds <= 1800)
                         ,
                         col3600 = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 1800 && (x.enddate - x.startdate).TotalSeconds <= 3600)
                         ,
                         colall = _cdrs.Count(x => x.startdate.Hour == int.Parse(wtime[0].ToString()) && (x.enddate - x.startdate).TotalSeconds > 3600)
                         ,
                         colavg = (int)_cdrs.Where(x => x.startdate.Hour == int.Parse(wtime[0].ToString())).Sum(x => (x.enddate - x.startdate).TotalSeconds)
                     }).ToList<CalltimePivot>()
                );
 */

        }
コード例 #10
0
ファイル: Calltime.cs プロジェクト: step4u/MiniCRM
        public Calltimes(string _chk, string _sdate, string _edate, string _teller)
        {
            DataTable dt = util.CreateDT2SP();

            dt.Rows.Add("@I_CHK", _chk);
            dt.Rows.Add("@I_SDATE", _sdate);
            dt.Rows.Add("@I_EDATE", _edate);
            dt.Rows.Add("@I_TELLER", _teller);

            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
            {
                try
                {
                    dt = db.GetDataTableSP("GET_LIST_BY_HOURS_BAK3", dt);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    //throw fe;
                }
            }

            List<Calltime> _oblist = new List<Calltime>(
                    (from _row in dt.AsEnumerable()
                     select new Calltime()
                     {
                         total = int.Parse(_row["O_TOTAL"].ToString())
                         ,
                         txt0 = _row["O_TXT0"].ToString()
                         ,
                         calledsec = int.Parse(_row["O_CALLED"].ToString())
                         ,
                         txt1 = _row["O_TXT1"].ToString()
                         ,
                         avgcalledsec = int.Parse(_row["O_AVGCALLED"].ToString())
                     }).ToList<Calltime>()
                );

            int _counterm = 8;
            int _avgcount = _oblist.Count() / _counterm;

            _list = new ObservableCollection<CalltimePivot>();
            for (int i = 0; i < _oblist.Count(); i += _counterm)
            {
                int k = 0;
                CalltimePivot _callpivot = new CalltimePivot();
                for (int j = i; j < i+_counterm; j++)
                {
                    _callpivot.timerange = _oblist[j].txt1;
                    _callpivot.totalnum = _oblist[j].total;
                    _callpivot.colavg = _oblist[j].avgcalledsec;
                    switch (k)
                    {
                        case 0:
                            _callpivot.col30 = _oblist[j].calledsec;
                            break;
                        case 1:
                            _callpivot.col60 = _oblist[j].calledsec;
                            break;
                        case 2:
                            _callpivot.col180 = _oblist[j].calledsec;
                            break;
                        case 3:
                            _callpivot.col300 = _oblist[j].calledsec;
                            break;
                        case 4:
                            _callpivot.col600 = _oblist[j].calledsec;
                            break;
                        case 5:
                            _callpivot.col1800 = _oblist[j].calledsec;
                            break;
                        case 6:
                            _callpivot.col3600 = _oblist[j].calledsec;
                            break;
                        case 7:
                            _callpivot.colall = _oblist[j].calledsec;
                            break;
                    }
                    k++;
                }
                _list.Add(_callpivot);
            }
        }
コード例 #11
0
ファイル: InnerTel.cs プロジェクト: step4u/MiniCRM
        public InnerTels()
        {
            DataTable dt = null;

            try
            {
                using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2))
                {
                    try
                    {
                        dt = db.GetDataTableSP("GET_INNERTELS");
                    }
                    catch (FirebirdSql.Data.FirebirdClient.FbException fe1)
                    {
                        //throw fe;
                        MessageBox.Show("test");
                    }
                }

                _list = new ObservableCollection<InnerTel>(
                        (from __row in dt.AsEnumerable()
                         select new InnerTel()
                         {
                             Seq = int.Parse(__row[0].ToString())
                             ,
                             Telnum = "   " + __row[1].ToString()
                             ,
                             TellerName = __row[2].ToString()
                         }
                        ).ToList<InnerTel>()
                    );

                //InnerTel _tmptel = new InnerTel() { Seq = 0, Telnum = "전체" };
                //_list.Insert(0, _tmptel);
            }
            catch (FirebirdSql.Data.FirebirdClient.FbException fe0)
            {
                _list = new ObservableCollection<InnerTel>();
                MessageBox.Show("Database 접속에 문제가 발생하였습니다.\r\n \"도구 → 환경설정 → 서버주소\"을 확인 후 다시 실행해 주세요.");
            }

        }
コード例 #12
0
ファイル: PhoneBook.xaml.cs プロジェクト: step4u/MiniCRM
        public CallLists GetCallListByCustIdx(int cust_idx, string cust_tel)
        {
            DataTable dt;
            CallLists lists = new CallLists();

            using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn()))
            {
                try
                {
                    db.SetParameters("@I_IDX", FbDbType.Integer, cust_idx);
                    db.SetParameters("@I_CUST_TEL", FbDbType.VarChar, cust_tel);

                    dt = db.GetDataTableSP("GET_CALL_LIST2");

                    foreach (DataRow row in dt.Rows)
                    {
                        lists.Add(new CallList()
                        {
                            IsChecked = false,
                            IsSelected = false,
                            Idx = string.IsNullOrEmpty(row[0].ToString()) == false ? int.Parse(row[0].ToString()) : -1,
                            Cust_Idx = string.IsNullOrEmpty(row[1].ToString()) == false ? int.Parse(row[1].ToString()) : -1,
                            Name = row[2].ToString(),
                            Direction = string.IsNullOrEmpty(row[3].ToString()) == false ? int.Parse(row[3].ToString()) : -1,
                            Cust_Tel = row[4].ToString(),
                            Startdate = string.IsNullOrEmpty(row[5].ToString()) == false ? DateTime.Parse(row[5].ToString()) : new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local),
                            Enddate = string.IsNullOrEmpty(row[6].ToString()) == false ? DateTime.Parse(row[6].ToString()) : new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local),
                            Memo = util.decStr(row[7].ToString())
                        });
                    }
                }
                catch (FbException ex)
                {
                    util.WriteLog(ex.ErrorCode, ex.Message);
                }
            }

            return lists;
        }
コード例 #13
0
ファイル: PhoneBook.xaml.cs プロジェクト: step4u/MiniCRM
        public Customer GetCustomerByTel(string tel)
        {
            DataTable dt;
            Customer cust = null;

            using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn()))
            {
                try
                {
                    db.SetParameters("@I_IDX", FbDbType.VarChar, tel);
                    dt = db.GetDataTableSP("GET_CUSTOMER_BY_TEL");

                    foreach (DataRow row in dt.Rows)
                    {
                        cust = new Customer()
                        {
                            IsChecked = false,
                            IsSelected = false,
                            Idx = string.IsNullOrEmpty(row[0].ToString()) == false ? int.Parse(row[0].ToString()) : -1,
                            Group_Idx = string.IsNullOrEmpty(row[1].ToString()) == false ? int.Parse(row[1].ToString()) : 0,
                            Name = row[2].ToString(),
                            Company = row[3].ToString(),
                            Title = row[4].ToString(),
                            Tel = row[5].ToString(),
                            Cellular = row[6].ToString(),
                            Extension = row[7].ToString(),
                            Email = row[8].ToString(),
                            Addr = row[9].ToString(),
                            Etc = row[10].ToString()
                        };
                    }
                }
                catch (FbException ex)
                {
                    util.WriteLog(ex.ErrorCode, ex.Message);
                }
            }

            return cust;
        }
コード例 #14
0
ファイル: MonthFee.cs プロジェクト: step4u/MiniCRM
        public MonthFees()
        {
            /*
            _monthfees.Add(new MonthFee() {
                CH_Idx = "6"
                , CH_Name = "어린이6"
                , FEE_DelayMonth = "1"
                , P_Idx = "19"
                , P_Name = "부모19"
                , P_Tel = "070-4694-6730"
            });

            _monthfees.Add(new MonthFee()
            {
                CH_Idx = "7"
                ,
                CH_Name = "어린이7"
                ,
                FEE_DelayMonth = "1"
                ,
                P_Idx = "19"
                ,
                P_Name = "부모19"
                ,
                P_Tel = "070-4694-6730"
            });
            */

            using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn))
            {
                DataTable dt = util.MakeDataTable2Proc();

                DataRow dr = dt.NewRow();
                dr["DataName"] = "@i_com_idx";
                dr["DataValue"] = util.Userinfo.COM_IDX;
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr["DataName"] = "@i_day";
                dr["DataValue"] = util.i_day;
                dt.Rows.Add(dr);

                try
                {
                    dt = db.GetDataTableSP("GET_MONTHFEE_LIST", dt);
                }
                catch (FirebirdSql.Data.FirebirdClient.FbException fe)
                {
                    throw fe;
                }

                _monthfees = new ObservableCollection<MonthFee>(
                                    (from myRow in dt.AsEnumerable()
                                     select new MonthFee()
                                     {
                                         P_Idx = myRow["o_p_idx"].ToString()
                                         , P_Name = myRow["o_p_name"].ToString()
                                         , P_Tel = myRow["o_p_tel"].ToString()
                                         , CH_Idx = myRow["o_ch_idx"].ToString()
                                         , CH_Name = myRow["o_ch_name"].ToString()
                                         , FEE_DelayMonth = myRow["o_fee_delay"].ToString()
                                         , FEE_STATUS = myRow["o_curstatus"].ToString()
                                     }).ToList<MonthFee>());
            }
        }