public HandlerResponse AddBlack() { SmsBlackphoneInfo info = new SmsBlackphoneInfo(); info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID; info.Phone = Request.Params["phone"]; info.CreateTime = DateTime.Now; SmsBlackPhoneManage.Instance.AddBlack(info); return CreateHandler(1, "添加成功"); }
public HandlerResponse EditBlack() { SmsBlackphoneInfo info = new SmsBlackphoneInfo(); info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID; info.Phone = Request.Params["phone"]; info.CreateTime = DateTime.Now; info.ID = Convert.ToInt32(Request.Params["id"]); SmsBlackPhoneManage.Instance.EditBlack(info); return CreateHandler(1, "修改成功"); }
public HandlerResponse AddBlack() { SmsBlackphoneInfo info = new SmsBlackphoneInfo(); info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID; info.Phone = Request.Params["phone"]; info.CreateTime = DateTime.Now; SmsBlackPhoneManage.Instance.AddBlack(info); return(CreateHandler(1, "添加成功")); }
public HandlerResponse EditBlack() { SmsBlackphoneInfo info = new SmsBlackphoneInfo(); info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID; info.Phone = Request.Params["phone"]; info.CreateTime = DateTime.Now; info.ID = Convert.ToInt32(Request.Params["id"]); SmsBlackPhoneManage.Instance.EditBlack(info); return(CreateHandler(1, "修改成功")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = Convert.ToInt32(Request.QueryString["id"]); BlackHandler handler = new BlackHandler(); SmsBlackphoneInfo info = handler.GetBlackInfo(id); phone = info.Phone; bid = info.ID.ToString(); Page.DataBind(); } }
public HandlerResponse upload() { string url = Request.Params["filename"].ToLower().Replace("master", ""); String dirPath = Path.Combine(Path.Combine(Request.PhysicalApplicationPath, "uplpod"), url); bool isheader = Request.Params["header"] == "1"; string spilter = Request.Params["spilter"]; string[] filearr = Request.Params["filearr"].TrimEnd('|').Split('|'); if (string.IsNullOrEmpty(dirPath)) { return(CreateHandler(0, "导入错误")); } else { if (System.IO.File.Exists(dirPath)) { var dt = FileUtily.ReadDataTable(dirPath, 0, spilter, isheader); if (dt == null || dt.Rows.Count == 0) { return(CreateHandler(0, "导入错误")); } else { List <SmsBlackphoneInfo> blacks = new List <SmsBlackphoneInfo>(); foreach (DataRow dr in dt.Rows) { SmsBlackphoneInfo black = new SmsBlackphoneInfo(); black.Phone = dr[int.Parse(filearr[0])].ToString(); if (!AppContent.isPhone(black.Phone)) { continue; } black.CreateTime = DateTime.Now; black.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID; blacks.Add(black); } SmsBlackPhoneManage.Instance.ImportList(blacks); } } return(CreateHandler(1, "导入成功")); } }
public HandlerResponse upload() { string url = Request.Params["filename"].ToLower().Replace("master", ""); String dirPath = Path.Combine(Path.Combine(Request.PhysicalApplicationPath, "uplpod"), url); bool isheader = Request.Params["header"] == "1"; string spilter = Request.Params["spilter"]; string[] filearr = Request.Params["filearr"].TrimEnd('|').Split('|'); if (string.IsNullOrEmpty(dirPath)) { return CreateHandler(0, "导入错误"); } else { if (System.IO.File.Exists(dirPath)) { var dt = FileUtily.ReadDataTable(dirPath, 0, spilter,isheader); if (dt == null || dt.Rows.Count == 0) { return CreateHandler(0, "导入错误"); } else { List<SmsBlackphoneInfo> blacks = new List<SmsBlackphoneInfo>(); foreach (DataRow dr in dt.Rows) { SmsBlackphoneInfo black = new SmsBlackphoneInfo(); black.Phone = dr[int.Parse(filearr[0])].ToString(); if(!AppContent.isPhone(black.Phone)) continue; black.CreateTime = DateTime.Now; black.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID; blacks.Add(black); } SmsBlackPhoneManage.Instance.ImportList(blacks); } } return CreateHandler(1, "导入成功"); } }