Ejemplo n.º 1
0
 public HandlerResponse AddKeyword()
 {
     SmsContentfilterkeyInfo info = new SmsContentfilterkeyInfo();
     info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID;
     info.Keyword = Request.Params["keyword"];
     info.CreateTime = DateTime.Now;
     SmsContentfilterkeyManage.Instance.AddKeyword(info);
     return CreateHandler(1, "添加成功");
 }
Ejemplo n.º 2
0
 public HandlerResponse EditKeyword()
 {
     SmsContentfilterkeyInfo info = new SmsContentfilterkeyInfo();
     info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID;
     info.Keyword = Request.Params["keyword"];
     info.CreateTime = DateTime.Now;
     info.ID = Convert.ToInt32(Request.Params["id"]);
     SmsContentfilterkeyManage.Instance.EditKeyword(info);
     return CreateHandler(1, "修改成功");
 }
Ejemplo n.º 3
0
        public HandlerResponse AddKeyword()
        {
            SmsContentfilterkeyInfo info = new SmsContentfilterkeyInfo();

            info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID;
            info.Keyword      = Request.Params["keyword"];
            info.CreateTime   = DateTime.Now;
            SmsContentfilterkeyManage.Instance.AddKeyword(info);
            return(CreateHandler(1, "添加成功"));
        }
Ejemplo n.º 4
0
        public HandlerResponse EditKeyword()
        {
            SmsContentfilterkeyInfo info = new SmsContentfilterkeyInfo();

            info.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID;
            info.Keyword      = Request.Params["keyword"];
            info.CreateTime   = DateTime.Now;
            info.ID           = Convert.ToInt32(Request.Params["id"]);
            SmsContentfilterkeyManage.Instance.EditKeyword(info);
            return(CreateHandler(1, "修改成功"));
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int                     id      = Convert.ToInt32(Request.QueryString["id"]);
         KeyWordHandler          handler = new KeyWordHandler();
         SmsContentfilterkeyInfo info    = handler.GetKeywordInfo(id);
         keyword = info.Keyword;
         kid     = info.ID.ToString();
         Page.DataBind();
     }
 }
Ejemplo n.º 6
0
        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);
                    if (dt == null || dt.Rows.Count == 0)
                    {
                        return(CreateHandler(0, "导入错误"));
                    }
                    else
                    {
                        List <SmsContentfilterkeyInfo> keys = new List <SmsContentfilterkeyInfo>();
                        foreach (DataRow dr in dt.Rows)
                        {
                            SmsContentfilterkeyInfo key = new SmsContentfilterkeyInfo();
                            key.Keyword      = dr[int.Parse(filearr[0])].ToString();
                            key.CreateTime   = DateTime.Now;
                            key.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID;
                            keys.Add(key);
                        }
                        SmsContentfilterkeyManage.Instance.ImportList(keys);
                    }
                }
                return(CreateHandler(1, "导入成功"));
            }
        }
Ejemplo n.º 7
0
 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);
             if (dt == null || dt.Rows.Count == 0)
             {
                 return CreateHandler(0, "导入错误");
             }
             else
             {
                 List<SmsContentfilterkeyInfo> keys = new List<SmsContentfilterkeyInfo>();
                 foreach (DataRow dr in dt.Rows)
                 {
                     SmsContentfilterkeyInfo key = new SmsContentfilterkeyInfo();
                     key.Keyword = dr[int.Parse(filearr[0])].ToString();
                     key.CreateTime = DateTime.Now;
                     key.EnterpriseID = AppContent.Current.GetCurrentUser().EnterpriseID;
                     keys.Add(key);
                 }
                 SmsContentfilterkeyManage.Instance.ImportList(keys);
             }
         }
         return CreateHandler(1, "导入成功");
     }
 }