コード例 #1
0
ファイル: GroupCallerDao.cs プロジェクト: lxh2014/gigade-net
 public List<groupCaller> QueryCallidById(groupCaller gc)
 {
     SqlParameter[] paras = new SqlParameter[]{
         new SqlParameter("@groupId",gc.groupId)
     };
     return _access.getDataTableForObj<groupCaller>("sp_GroupCaller_QueryCallidById_xuanzi0404h", paras);
 }
コード例 #2
0
ファイル: GroupCallerDao.cs プロジェクト: lxh2014/gigade-net
        public int Delete(groupCaller gc)
        {
            SqlParameter[] paras = new SqlParameter[]{
                new SqlParameter("@groupId",gc.groupId)
            };

            return _access.execCommand("sp_GroupCaller_Delete_xuanzi0404h", paras);
        }
コード例 #3
0
ファイル: GroupCallerMgr.cs プロジェクト: lxh2014/gigade-net
 public int Delete(groupCaller gc)
 {
     
     try
     {
         return _gcDao.Delete(gc);
     }
     catch (Exception ex)
     {
         throw new Exception("GroupCallerMgr-->Delete-->" + ex.Message, ex);
     }
 }
コード例 #4
0
ファイル: GroupCallerMgr.cs プロジェクト: lxh2014/gigade-net
 public int Save(groupCaller gc)
 {
     
     try
     {
         return _gcDao.Save(gc);
     }
     catch (Exception ex)
     {
         throw new Exception("GroupCallerMgr-->SingleCompareSave-->" + ex.Message, ex);
     }
 }
コード例 #5
0
ファイル: GroupCallerMgr.cs プロジェクト: lxh2014/gigade-net
        public string QueryCallidById(groupCaller gc)
        {
            try
            {
                List<groupCaller> gcResult = _gcDao.QueryCallidById(gc);
                StringBuilder stb = new StringBuilder();

                foreach (groupCaller gcs in gcResult)
                {
                    stb.Append(string.Format("{0}", gcs.callid));
                    stb.Append(",");
                }
                return stb.ToString().Length > 0 ? stb.ToString().Substring(0, stb.ToString().Length - 1) : "";
            }
            catch (Exception ex)
            {
                throw new Exception("GroupCallerMgr-->QueryCallidById-->" + ex.Message, ex);
            }
            
        }
コード例 #6
0
        public string QueryPm()
        {
            gcMgr = new GroupCallerMgr(connectionString);
            paraMgr = new ParameterMgr(connectionString);
            fgMgr = new FgroupMgr(connectionString);
            muMgr = new ManageUserMgr(connectionString);
            groupCaller gc = new groupCaller();
            Fgroup fg = new Fgroup();
            string json = string.Empty;

            try
            {
                List<Parametersrc> parstore = paraMgr.QueryUsed(new Parametersrc { ParameterType = "vendor_pm" }).ToList();

                if (parstore.Count != 0)
                {
                    fg.groupCode = parstore[0].ParameterCode;
                    //  fg.groupName = parstore[0].parameterName;//parameterName是可變的不可依此查詢 edit by shuangshuang0420j 2015.07.28 09:48
                    Fgroup pmfg = fgMgr.GetSingle(fg);
                    if (pmfg != null)
                    {
                        gc.groupId = pmfg.rowid;
                        string pm = gcMgr.QueryCallidById(gc);
                        StringBuilder stb = new StringBuilder("");
                        stb.Append("{");
                        stb.Append("success:true,item:[");
                        //stb.Append("{");
                        //stb.AppendFormat("\"userId\":\"{0}\",\"userName\":\"{1}\"", 0, "請選擇");
                        //stb.Append("}");
                        string nameStr = string.Empty;

                        string[] pmar = pm.Split(',').ToArray();
                        foreach (var item in pmar)
                        {
                            int total = 0;
                            ManageUserQuery mu = muMgr.GetManageUserList(new ManageUserQuery { user_email = item, search_status = "-1" }, out total).FirstOrDefault();
                            if (total == 1 && mu != null)
                            {
                                stb.Append("{");
                                stb.AppendFormat("\"userId\":\"{0}\",\"userName\":\"{1}\"", mu.user_id, mu.user_username);
                                stb.Append("}");
                            }
                        }
                        stb.Append("]}");
                        json = stb.ToString().Replace("}{", "},{");
                    }
                    //else
                    //{
                    //    json = "{success:false,error:1}";
                    //}
                }
                //else
                //{
                //    json = "{success:false,error:0}";
                //}
            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                json = "[]";
            }

            return json;

        }
コード例 #7
0
 public int Delete(groupCaller gc)
 {
     return _access.execCommand("delete from t_groupcaller where groupid=" + gc.groupId);
 }
コード例 #8
0
 public int Save(groupCaller gc)
 {
     return _access.execCommand("insert into t_groupcaller(groupid,callid) values('"+gc.groupId+"','"+gc.callid+"')");
 }
コード例 #9
0
 public List<groupCaller> QueryCallidById(groupCaller gc)
 {
     return _access.getDataTableForObj<groupCaller>("select callid from t_groupcaller where groupid = " + gc.groupId);
 }