Exemplo n.º 1
0
        public HandlerResponse GetList()
        {
            int PageIndex = int.Parse(Request.Params["PageIndex"]);
            int PageSize = int.Parse(Request.Params["PageSize"]);
            string phone = Request.Params["phone"];
            string content = Request.Params["content"];
            string starttime = Request.Params["starttime"];
            string endtime = Request.Params["endtime"];
            PageList<SmsMoInfo> infos = SmsMOManage.Instance.GetList(PageIndex, PageSize
                ,phone,content,starttime,endtime,AppContent.Current.GetCurrentUser().EnterpriseID);

            JsonFlexiGridData data = new JsonFlexiGridData();
            data.rows = new List<FlexiGridRow>();
            foreach (var item in infos)
            {
                FlexiGridRow row = new FlexiGridRow();
                row.id = item.ID.ToString();
                row.cell = new Dictionary<string, object>();
                row.cell.Add("id", item.ID);
                row.cell.Add("phone", item.Phone);
                row.cell.Add("content", item.Content);
                row.cell.Add("createtime", DateTostr(item.CreateTime));
                data.rows.Add(row);
            }
            data.page = PageIndex;
            data.total = infos.TotalCount;
            return CreateHandler(101, new JavaScriptSerializer().Serialize(data));
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            List<User> users = new List<User>();
            for (int i = 0; i < 15; i++)
            {
                User user = new User();
                user.id = i;
                user.name = Guid.NewGuid().ToString();
                users.Add(user);
            }
            JsonFlexiGridData data = new JsonFlexiGridData();
            data.rows = new List<FlexiGridRow>();
            foreach (var item in users)
            {
                FlexiGridRow row = new FlexiGridRow();
                row.id = item.id.ToString();
                row.cell = new Dictionary<string, object>();
                row.cell.Add("id", item.id);
                row.cell.Add("name", item.name);
                row.cell.Add("identity", item.identity);
                data.rows.Add(row);
            }
            data.page = 1;
            data.total = users.Count;
            context.Response.Write(new JavaScriptSerializer().Serialize(data));
        }
Exemplo n.º 3
0
        public HandlerResponse GetList()
        {
            int PageIndex = int.Parse(Request.Params["PageIndex"]);
            int PageSize = int.Parse(Request.Params["PageSize"]);
            string batchname = Request.Params["batchname"];
            string state = Request.Params["state"];
            string starttime = Request.Params["starttime"];
            string endtime = Request.Params["endtime"];
            PageList<BatchMoreInfo> infos = SmsBatchManage.Instance.GetList(PageIndex, PageSize
                , batchname, state, starttime, endtime,AppContent.Current.GetCurrentUser().EnterpriseID);

            JsonFlexiGridData data = new JsonFlexiGridData();
            data.rows = new List<FlexiGridRow>();
            foreach (var item in infos)
            {
                FlexiGridRow row = new FlexiGridRow();
                row.id = item.ID.ToString();
                row.cell = new Dictionary<string, object>();
                row.cell.Add("id", item.ID);
                row.cell.Add("batchname", item.BatchName);
                row.cell.Add("content", item.SmsContent);
                string batchstate = "提交中";
                if (item.BatchState != null)
                    switch (item.BatchState.Value)
                    {
                        case 1: batchstate = "检核中";
                            break;
                        case 2: batchstate = "等待中";
                            break;
                        case 3: batchstate = "发送中";
                            break;
                        case 4: batchstate = "完成";
                            break;
                    }
                row.cell.Add("state", batchstate);
                row.cell.Add("sendamount", item.SendAmount);
                row.cell.Add("successamount", item.SuccessAmount);
                row.cell.Add("posttime", DateTostr(item.PostTime));
                row.cell.Add("createtime", DateTostr(item.CreateTime));
                 data.rows.Add(row);
            }
            data.page = PageIndex;
            data.total = infos.TotalCount;
            return CreateHandler(101, new JavaScriptSerializer().Serialize(data));
        }
Exemplo n.º 4
0
        public HandlerResponse getList()
        {
            int gid = int.Parse(Request.Params["gid"]);
            string name = Request.Params["name"];
            string phone = Request.Params["phone"];
            int PageIndex = int.Parse(Request.Params["PageIndex"]);
            int PageSize = int.Parse(Request.Params["PageSize"]);
            PageList<SmsContactInfo> infos = SmsContactManage.Instance.getList(PageIndex, PageSize, gid, name, phone,AppContent.Current.GetCurrentUser().EnterpriseID);

            JsonFlexiGridData data = new JsonFlexiGridData();
            data.rows = new List<FlexiGridRow>();
            foreach (var item in infos)
            {
                FlexiGridRow row = new FlexiGridRow();
                row.id = item.ID.ToString();
                row.cell = new Dictionary<string, object>();
                row.cell.Add("id", item.ID);
                row.cell.Add("phone", item.Mobile);
                row.cell.Add("name", item.Name);
                row.cell.Add("comment", item.Comment);
                switch (item.Sex)
                {
                    case 1:
                        row.cell.Add("sex", "男");
                        break;
                    case 2:
                        row.cell.Add("sex", "女"); break;
                    default:
                        row.cell.Add("sex", "保密"); break;
                }
                row.cell.Add("birthday", DateTostr(item.Birthday));
                row.cell.Add("createtime", DateTostr(item.CreateTime));
                data.rows.Add(row);
            }
            data.page = PageIndex;
            data.total = infos.TotalCount;
            return CreateHandler(101, new JavaScriptSerializer().Serialize(data));
        }
Exemplo n.º 5
0
        public HandlerResponse GetList()
        {
            int PageIndex = int.Parse(Request.Params["PageIndex"]);
            int PageSize = int.Parse(Request.Params["PageSize"]);
            string phone = Request.Params["phone"];
            string state = Request.Params["state"];
            string starttime = Request.Params["starttime"];
            string endtime = Request.Params["endtime"];
            PageList<SmsBatchDetailsMoreInfo> infos = SmsBatchDetailsManage.Instance.GetList(PageIndex, PageSize
                , phone, state, starttime, endtime,AppContent.Current.GetCurrentUser().EnterpriseID);

            JsonFlexiGridData data = new JsonFlexiGridData();
            data.rows = new List<FlexiGridRow>();
            foreach (var item in infos)
            {
                FlexiGridRow row = new FlexiGridRow();
                row.id = item.ID.ToString();
                row.cell = new Dictionary<string, object>();
                row.cell.Add("id", item.ID);
                row.cell.Add("phone", item.Phone);
                row.cell.Add("content", item.Content);
                row.cell.Add("batchname",item.BatchName);
                string result = "";
                switch (item.State.Value)
                {
                    case 0:
                        result = "失败";
                        break;
                    case 1:
                        result = "成功";
                        break;
                    case 2:
                        result = "账号无效";
                        break;
                    case 3:
                        result = "余额不足";
                        break;
                    case 4:
                        result = "用户名密码错误";
                        break;
                    case 5:
                        result = "资金账户不存在";
                        break;
                    case 6:
                        result = "包号码数量超过最大限制";
                        break;
                    case 7:
                        result = "参数无效";
                        break;
                    case 8:
                        result = "系统内部错误";
                        break;
                    case 9:
                        result = "手机或者内容错误";
                        break;
                    case 10:
                        result = "网络连接错误";
                        break;
                }
                row.cell.Add("state", result);
                row.cell.Add("stateremark", item.StateReport);
                row.cell.Add("posttime", DateTostr(item.SubmitTime));
                data.rows.Add(row);
            }
            data.page = PageIndex;
            data.total = infos.TotalCount;
            return CreateHandler(101, new JavaScriptSerializer().Serialize(data));
        }
Exemplo n.º 6
0
        public HandlerResponse GetList()
        {
            int PageIndex = int.Parse(Request.Params["PageIndex"]);
            int PageSize = int.Parse(Request.Params["PageSize"]);
            PageList<SmsEnterpriseInfo> infos = SmsEnterpriseManage.Instance.GetList(PageIndex, PageSize);

            JsonFlexiGridData data = new JsonFlexiGridData();
            data.rows = new List<FlexiGridRow>();
            foreach (var item in infos)
            {
                FlexiGridRow row = new FlexiGridRow();
                row.id = item.ID.ToString();
                row.cell = new Dictionary<string, object>();
                row.cell.Add("id", item.ID);
                row.cell.Add("name", item.EnterpriseName);
                row.cell.Add("introduction", item.Introduction);
                row.cell.Add("smsprice", item.SmsPrice);
                row.cell.Add("chinamobile", item.ChinaMobile);
                row.cell.Add("union", item.Union);
                row.cell.Add("cdma", item.Cdma);
                row.cell.Add("capital", item.Capital);
                row.cell.Add("smslength", item.SmsLength);
                row.cell.Add("createtime", DateTostr(item.CreateTime));
                data.rows.Add(row);
            }
            data.page = PageIndex;
            data.total = infos.TotalCount;
            return CreateHandler(101, new JavaScriptSerializer().Serialize(data));
        }
Exemplo n.º 7
0
        public HandlerResponse GetList()
        {
            int PageIndex = int.Parse(Request.Params["PageIndex"]);
            int PageSize = int.Parse(Request.Params["PageSize"]);
            PageList<SmsAccountInfo> infos = SmsAccountManage.Instance.GetList(PageIndex, PageSize);

            JsonFlexiGridData data = new JsonFlexiGridData();
            data.rows = new List<FlexiGridRow>();
            foreach (var item in infos)
            {
                FlexiGridRow row = new FlexiGridRow();
                row.id = item.ID.ToString();
                row.cell = new Dictionary<string, object>();
                row.cell.Add("id", item.ID);
                row.cell.Add("account", item.Account);
                row.cell.Add("createtime", DateTostr(item.Createtime));
                row.cell.Add("logintime", DateTostr(item.LoginTime));
                row.cell.Add("state", item.State.Value == 0 ? "禁用" : "正常");
                row.cell.Add("eid", item.EnterpriseID);
                row.cell.Add("signature", item.Signature);
                data.rows.Add(row);
            }
            data.page = PageIndex;
            data.total = infos.TotalCount;
            return CreateHandler(101, new JavaScriptSerializer().Serialize(data));
        }