Example #1
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);

            BLL.address bll = new BLL.address();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("address_list.aspx", "user_id={0}&page={1}",
                                              this.user_id.ToString(), "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Example #2
0
 protected DataTable get_address_list(int pageSize, int pageIndex, string strWhere, string strorder, out int totalcount)
 {
     BLL.address bll = new BLL.address();
     return bll.GetList(pageSize, pageIndex, strWhere, strorder, out totalcount).Tables[0];
 }
Example #3
0
 protected DataTable get_address_list(int top,string strwhere,string strorder)
 {
     BLL.address bll = new BLL.address();
     return bll.GetList(top, strwhere, strorder).Tables[0];
 }
Example #4
0
        private void car_add_address(HttpContext context)
        {
            Model.users model = new BasePage().GetUserInfo();
            if (model == null)
            {
                context.Response.Write("Lost");
                return;
            }
            int province = DTRequest.GetFormInt("car_province");
            int city = DTRequest.GetFormInt("car_city");
            int district = DTRequest.GetFormInt("car_district");
            string address = DTRequest.GetFormString("car_address");
            string consignee = DTRequest.GetFormString("car_consignee");
            string consignee_mobile = DTRequest.GetFormString("car_consignee_mobile");
            string consignee_company = DTRequest.GetFormString("car_consignee_company");
            //非必填
            string zip_phone = DTRequest.GetFormString("car_zip_phone");
            string phone = DTRequest.GetFormString("car_phone");

            BLL.address bll = new BLL.address();
            Model.address model_address = new Model.address();
            model_address.user_id = model.id;
            model_address.province = province;
            model_address.city = city;
            model_address.distract = district;
            model_address.content = address;

            model_address.consignee = consignee;
            model_address.consignee_mobile = consignee_mobile;
            model_address.add_time = DateTime.Now;
            model_address.company_address = consignee_company;
            model_address.consignee_phone = zip_phone + "-" + phone;

            int new_id = bll.Add(model_address);
            if (new_id <= 0)
            {
                context.Response.Write("Error");
                return;
            }
            DataTable dt = bll.GetList("user_id=" + model.id).Tables[0];
            DataTable ret_dt = new DataTable();
            ret_dt.Columns.Add("id");
            ret_dt.Columns.Add("address");
            ret_dt.Columns.Add("selected");
            ret_dt.PrimaryKey = new DataColumn[] { ret_dt.Columns["id"] };

            foreach (DataRow dr in dt.Rows)
            {
                DataRow ret_dr = ret_dt.NewRow();
                ret_dr["id"] = dr["id"];
                string province1 = new BasePage().get_province_title(Convert.ToInt32(dr["province"]));
                string city1 = new BasePage().get_city_title(Convert.ToInt32(dr["city"]));
                string district1 = new BasePage().get_district_title(Convert.ToInt32(dr["distract"]));
                string address1 = dr["content"].ToString();
                string consignee1 = dr["consignee"].ToString();
                string consignee_mobile1 = dr["consignee_mobile"].ToString();
                string company_address = dr["company_address"].ToString();
                ret_dr["address"] = province1 + " " + city1 + " " + district1 + " " + address1 + "(公司地址:" + company_address + ")" + " " + consignee1 + ":" + consignee_mobile1;
                if (Convert.ToInt32(dr["id"]) == new_id)
                {
                    ret_dr["selected"] = 1;
                }
                else
                {
                    ret_dr["selected"] = 0;
                }
                ret_dt.Rows.Add(ret_dr);
            }

            if (ret_dt != null && ret_dt.Rows.Count > 0)
            {
                context.Response.Write(myJson.getJson(ret_dt));
                return;
            }
            else
            {
                context.Response.Write("Null");
                return;
            }
        }
Example #5
0
        private void save_user_info(HttpContext context)
        {
            string nick_name = DTRequest.GetFormString("nick_name");
            string email = DTRequest.GetFormString("email");
            string mobile = DTRequest.GetFormString("mobile");
            string sex = DTRequest.GetFormString("sex");
            string txtBirthday = DTRequest.GetFormString("txtBirthday");
            int province = DTRequest.GetFormInt("province");
            int city = DTRequest.GetFormInt("city");
            int district = DTRequest.GetFormInt("district");
            string address = DTRequest.GetFormString("address");

            string purchase = DTRequest.GetFormString("purchase");
            string purchase_mobile = DTRequest.GetFormString("purchase_mobile");

            Model.users model = new BasePage().GetUserInfo();
            if (model == null)
            {
                context.Response.Write("{\"status\":0, \"msg\":\"对不起,请重新登录!\"}");
                return;
            }
            BLL.users bll = new BLL.users();

            model.nick_name = nick_name;
            model.email = email;
            model.mobile = mobile;
            if (!string.IsNullOrEmpty(sex))
            {
                model.sex = sex;
            }
            else
            {
                model.sex = "保密";
            }
            if (!string.IsNullOrEmpty(txtBirthday))
            {
                model.birthday = Convert.ToDateTime(txtBirthday);
            }
            model.province = province;
            model.city = city;
            model.district = district;
            model.address = address;
            model.purchase = purchase;
            model.purchase_mobile = purchase_mobile;
            if (bll.Update(model))
            {
                BLL.address bll_address = new BLL.address();
                if (bll_address.GetList("user_id=" + model.id).Tables[0].Rows.Count <= 0)
                {
                    Model.address model_address = new Model.address();

                    if (model.user_type == 2)
                    {
                        model_address.consignee = purchase;
                        model_address.consignee_mobile = purchase_mobile;
                    }
                    else
                    {
                        model_address.consignee = nick_name;
                        model_address.consignee_mobile = mobile;
                    }
                    model_address.user_id = model.id;
                    model_address.province = model.province;
                    model_address.city = model.city;
                    model_address.distract = model.district;
                    model_address.content = model.address;
                    model_address.add_time = DateTime.Now;

                    bll_address.Add(model_address);
                }
                context.Response.Write("{\"status\":1, \"msg\":\"保存成功!\"}");
                return;
            }
            else
            {
                context.Response.Write("{\"status\":0, \"msg\":\"保存失败!\"}");
                return;
            }
        }
Example #6
0
        private void get_address(HttpContext context)
        {
            Model.users model = new BasePage().GetUserInfo();
            if (model == null)
            {
                context.Response.Write("Error");
                return;
            }

            BLL.address bll = new BLL.address();
            DataTable dt = bll.GetList("user_id=" + model.id).Tables[0];

            DataTable ret_dt = new DataTable();
            ret_dt.Columns.Add("id");
            ret_dt.Columns.Add("address");
            ret_dt.PrimaryKey = new DataColumn[] { ret_dt.Columns["id"] };

            foreach (DataRow dr in dt.Rows)
            {
                DataRow ret_dr = ret_dt.NewRow();
                ret_dr["id"] = dr["id"];
                string province = new BasePage().get_province_title(Convert.ToInt32(dr["province"]));
                string city = new BasePage().get_city_title(Convert.ToInt32(dr["city"]));
                string district = new BasePage().get_district_title(Convert.ToInt32(dr["distract"]));
                string address = dr["content"].ToString();
                string consignee = dr["consignee"].ToString();
                string consignee_mobile = dr["consignee_mobile"].ToString();
                string company_address = dr["company_address"].ToString();
                ret_dr["address"] = province + " " + city + " " + district + " " + address + "(公司地址:" + company_address + ")" + " " + consignee + ":" + consignee_mobile;

                ret_dt.Rows.Add(ret_dr);
            }

            if (ret_dt != null && ret_dt.Rows.Count > 0)
            {
                context.Response.Write(myJson.getJson(ret_dt));
                return;
            }
            else
            {
                context.Response.Write("Null");
                return;
            }
        }
Example #7
0
 protected DataTable get_address_list(int pageSize, int pageIndex, string strWhere, string strorder, out int totalcount)
 {
     BLL.address bll = new BLL.address();
     return(bll.GetList(pageSize, pageIndex, strWhere, strorder, out totalcount).Tables[0]);
 }
Example #8
0
 protected DataTable get_address_list(int top, string strwhere, string strorder)
 {
     BLL.address bll = new BLL.address();
     return(bll.GetList(top, strwhere, strorder).Tables[0]);
 }
Example #9
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);

            BLL.address bll = new BLL.address();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("address_list.aspx", "user_id={0}&page={1}",
                this.user_id.ToString(), "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }