コード例 #1
0
        private string getPickupList(HttpContext context)
        {
            StringBuilder sb       = new StringBuilder();
            DataSet       ds       = new DataSet();
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" is_delete != 1");

            WK.BLL.bus_pickup_address bll = new WK.BLL.bus_pickup_address();
            ds = bll.GetList(strWhere.ToString());
            DataTable dt = new DataTable();

            dt.Columns.Add("data", typeof(System.Int32));
            dt.Columns.Add("value", typeof(System.String));
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                int l = ds.Tables[0].Rows.Count;
                for (int i = 0; i < l; i++)
                {
                    DataRow row = dt.NewRow();
                    row["data"]  = ds.Tables[0].Rows[i]["id"];
                    row["value"] = ds.Tables[0].Rows[i]["name"];
                    dt.Rows.Add(row);
                }
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(dt));
        }
コード例 #2
0
ファイル: bus_pickup.ashx.cs プロジェクト: peakcary/net-wk
        private string getDataDetail(HttpContext context)
        {
            string id = "";

            if (context.Request.Params["id"] != null)
            {
                id = context.Request.Params["id"];
            }
            WK.BLL.bus_pickup_address   bll   = new WK.BLL.bus_pickup_address();
            WK.Model.bus_pickup_address model = bll.GetModel(int.Parse(id));
            return(Newtonsoft.Json.JsonConvert.SerializeObject(model));
        }
コード例 #3
0
ファイル: bus_pickup.ashx.cs プロジェクト: peakcary/net-wk
        private string getListCount(HttpContext context)
        {
            StringBuilder sb       = new StringBuilder();
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" is_delete != 1");
            WK.BLL.bus_pickup_address bll = new WK.BLL.bus_pickup_address();
            Record r = new Record();

            r.RecordCount = bll.GetListCount(strWhere.ToString());
            return(Newtonsoft.Json.JsonConvert.SerializeObject(r));
        }
コード例 #4
0
ファイル: bus_pickup.ashx.cs プロジェクト: peakcary/net-wk
        private string deleteData(HttpContext context)
        {
            ReturnInfo returnInfo = new ReturnInfo();

            returnInfo.isSuccess = false;
            WK.BLL.bus_pickup_address bll = new WK.BLL.bus_pickup_address();
            int id = int.Parse(context.Request.Params["id"]);

            if (id > 0)
            {
                returnInfo.isSuccess = bll.Delete(id);
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(returnInfo));
        }
コード例 #5
0
ファイル: bus_pickup.ashx.cs プロジェクト: peakcary/net-wk
        private string deleteDataByStatus(HttpContext context)
        {
            ReturnInfo returnInfo = new ReturnInfo();

            returnInfo.isSuccess = false;
            WK.BLL.bus_pickup_address bll = new WK.BLL.bus_pickup_address();
            int id = int.Parse(context.Request.Params["id"]);

            if (id > 0)
            {
                WK.Model.bus_pickup_address model = bll.GetModel(id);
                model.is_delete      = 1;
                returnInfo.isSuccess = bll.Update(model);
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(returnInfo));
        }
コード例 #6
0
ファイル: bus_pickup.ashx.cs プロジェクト: peakcary/net-wk
        private string editData(HttpContext context)
        {
            ReturnInfo returnInfo = new ReturnInfo();

            returnInfo.isSuccess = false;

            WK.Model.bus_pickup_address model = new Model.bus_pickup_address();

            int id = 0;

            if (context.Request.Params["id"] != "")
            {
                id = int.Parse(context.Request.Params["id"]);
            }
            model.id      = id;
            model.address = context.Request.Params["address"];
            model.area_id = 0;
            //model.create_by
            //model.create_date
            model.dilivery_user_id = int.Parse(context.Request.Params["dilivery_user_id"]);
            model.is_delete        = 0;
            model.lat         = decimal.Parse(context.Request.Params["lat"]);
            model.lon         = decimal.Parse(context.Request.Params["lon"]);
            model.name        = context.Request.Params["name"];
            model.pickup_code = context.Request.Params["pickup_code"];
            model.remark      = context.Request.Params["remark"];
            model.sort        = int.Parse(context.Request.Params["sort"]);
            model.status      = int.Parse(context.Request.Params["status"]);;//1启用2停用
            //model.update_by
            //model.update_date


            WK.BLL.bus_pickup_address bll = new WK.BLL.bus_pickup_address();
            if (model.id > 0)
            {
                returnInfo.isSuccess = bll.Update(model);
            }
            else
            {
                returnInfo.isSuccess = bll.Add(model);
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(returnInfo));
        }
コード例 #7
0
ファイル: bus_pickup.ashx.cs プロジェクト: peakcary/net-wk
        private string getListByPageInfo(HttpContext context)
        {
            StringBuilder sb       = new StringBuilder();
            DataSet       ds       = new DataSet();
            StringBuilder strWhere = new StringBuilder();

            strWhere.Append(" is_delete != 1");
            StringBuilder orderby = new StringBuilder();

            int pageIndex  = int.Parse(context.Request.Params["pageIndex"]);
            int pageSize   = int.Parse(context.Request.Params["pageSize"]);
            int startIndex = 0;

            if (pageIndex >= 0)
            {
                startIndex = pageSize * pageIndex;
            }

            WK.BLL.bus_pickup_address bll = new WK.BLL.bus_pickup_address();
            ds = bll.GetListByPageInfo(strWhere.ToString(), orderby.ToString(), startIndex, pageSize);
            return(Newtonsoft.Json.JsonConvert.SerializeObject(ds.Tables[0]));
        }