Example #1
0
        public string QueryCallid()
        {

            vgMgr = new VgroupMgr(mySqlConnectionString);

            string json = string.Empty;

            try
            {
                json = vgMgr.QueryCallid();
            }
            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;
        }
Example #2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public HttpResponseBase Delete()
        {
            vgMgr = new VgroupMgr(mySqlConnectionString);
            string json = string.Empty;

            try
            {
                if (!string.IsNullOrEmpty(Request.Form["rowID"]))
                {
                    string rowIDs = Request.Form["rowID"];
                    if (rowIDs.IndexOf("|") != -1)
                    {
                        foreach (string id in rowIDs.Split('|'))
                        {
                            if (!string.IsNullOrEmpty(id))
                            {
                                vg.rowid = Int32.Parse(id);
                                vgMgr.Delete(vg);
                            }
                        }
                        json = "{success:true,msg:\"删除成功\"}";
                    }
                    else
                    {
                        json = "{success:true,msg:\"删除失败\"}";
                    }
                }
                else
                {
                    json = "{success:true,msg:\"删除失败\"}";
                }
            }
            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 = "{success:true,msg:\"删除失败\"}";
            }

            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();

            return this.Response;
        }
Example #3
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        public HttpResponseBase Edit()
        {
            vgMgr = new VgroupMgr(mySqlConnectionString);
            string json = string.Empty;

            try
            {
                if (!string.IsNullOrEmpty(Request.Form["rowid"]))
                {
                    vg.rowid = Convert.ToInt32(Request.Form["rowid"]);
                }

                if (!string.IsNullOrEmpty(Request.Form["groupName"]))
                {
                    vg.groupName = Request.Form["groupName"];
                }

                if (!string.IsNullOrEmpty(Request.Form["groupCode"]))
                {
                    vg.groupCode = Request.Form["groupCode"];
                }

                if (!string.IsNullOrEmpty(Request.Form["remark"]))
                {
                    vg.remark = Request.Form["remark"];
                }

                vg.kuser = "";
                int num = vgMgr.Save(vg);

                if (num == -1)
                {
                    json = "{success:true,msg:\"群組名稱 或 群組編號已存在。\"}";
                }
                else if (num == 2)
                {
                    json = "{success:true,msg:\"修改成功\"}";
                }
                else
                {
                    json = "{success:true,msg:\"修改失败\"}";
                }
            }
            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 = "{success:true,msg:\"修改失败\"}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;
        }