public string QueryCallidById() { gcMgr = new VGroupCallerMgr(mySqlConnectionString); string json = string.Empty; try { if (!string.IsNullOrEmpty(Request.Form["groupId"])) { gc.groupId = Convert.ToInt32(Request.Form["groupId"]); } json = gcMgr.QueryCallidById(gc); } 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; }
/// <summary> /// 人員管理 /// </summary> /// <returns></returns> public HttpResponseBase AddCallid() { gcMgr = new VGroupCallerMgr(mySqlConnectionString); string json = string.Empty; try { if (!string.IsNullOrEmpty(Request.Form["groupId"])) { gc.groupId = Int32.Parse(Request.Form["groupId"]); } if (!string.IsNullOrEmpty(Request.Form["callid"])) { string[] callid = Request.Form["callid"].IndexOf(",") != -1 ? Request.Form["callid"].Split(',') : new string[] { Request.Form["callid"] }; gcMgr.Delete(gc); foreach (string id in callid) { if (!string.IsNullOrEmpty(id)) { gc.callid = id; gcMgr.Save(gc); } } } 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; }