예제 #1
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("outlet_list", Vincent._DTcms.DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.outlet bll = new BLL.outlet();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(Vincent._DTcms.DTEnums.ActionEnum.Delete.ToString(), "删除店铺成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Vincent._DTcms.Utils.CombUrlTxt("outlet_list.aspx", "status={0}&payment_status={1}&express_status={2}&keywords={3}",
                                                                                                       this.status.ToString(), this.payment_status.ToString(), this.express_status.ToString(), this.keywords), "Success");
        }
예제 #2
0
        private void BrandBind(DropDownList ddl, int role_id)
        {
            BLL.outlet bll = new BLL.outlet();
            DataTable  dt  = bll.GetList(0, "0=0", "addtime desc,id asc").Tables[0];

            ddl.Items.Clear();
            ddl.Items.Add(new ListItem("请选择店铺...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                ddl.Items.Add(new ListItem("(" + dr["provinces"].ToString() + dr["city"].ToString() + dr["area"].ToString() + ")" + dr["name"].ToString(), dr["id"].ToString()));
            }
        }
예제 #3
0
        protected string CombSqlTxt(int _outlet_id, int _city_id, string _keywords)
        {
            StringBuilder strTemp = new StringBuilder();

            if (_city_id > 0)
            {
                BLL.openarea   open  = new BLL.openarea();
                Model.openarea openm = open.GetModel(_city_id);
                if (openm != null)
                {
                    BLL.outlet outlet = new BLL.outlet();
                    DataTable  dt     = outlet.GetList(0, " city='" + openm.city + "'", " id").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        StringBuilder st = new StringBuilder();
                        string        ss = string.Empty;
                        st.Append("(");
                        foreach (DataRow item in dt.Rows)
                        {
                            st.Append(item["id"] + ",");
                        }
                        if (st.ToString().Trim() != "(")
                        {
                            ss = DelLastComma(st.ToString().Trim());
                            st.Append(")");
                        }
                        strTemp.Append(" and store_id in" + ss + ")");
                    }
                    else
                    {
                        strTemp.Append(" and store_id in(null)");
                    }
                }
            }

            if (_outlet_id > 0)
            {
                strTemp.Append(" and store_id=" + _outlet_id);
            }

            _keywords = _keywords.Replace("'", "");
            if (!string.IsNullOrEmpty(_keywords))
            {
                strTemp.Append(" and (user_name='" + _keywords + "' or remark like '%" + _keywords + "%')");
            }

            return(strTemp.ToString());
        }
예제 #4
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            Model.outlet model = new Model.outlet();
            BLL.outlet   bll   = new BLL.outlet();

            if (this.provinces1.Value == "所在省份")
            {
                JscriptMsg("请选择省份!", "", "Error");
                return(result);
            }

            model.id        = _id;
            model.provinces = this.provinces1.Value;
            model.city      = this.city1.Value;
            model.area      = this.area1.Value;
            model.street    = txtaddress.Text;
            model.address   = provinces1.Value + city1.Value + area1.Value + txtaddress.Text;
            //model.provinces = provinces.Items[provinces.SelectedIndex].Text;
            //model.city = city.Items[city.SelectedIndex].Text;
            //model.area = area.Items[area.SelectedIndex].Text;
            //model.address = provinces.Items[provinces.SelectedIndex].Text + city.Items[city.SelectedIndex].Text + area.Items[area.SelectedIndex].Text + txtaddress.Text;
            model.name      = txtTitle.Text;
            model.img       = txtImgUrl.Text;
            model.busintime = busintime.Text;
            model.mobile    = txtmobile.Text;
            model.x_zb      = txtX.Text.ToString();
            model.y_zb      = txtY.Text.ToString();
            model.Linkman   = TextLinkman.Text;
            model.WeChat    = TextWeChat.Text;
            model.Other     = TextOther.Text;
            model.userId    = Convert.ToInt32(DropDownList1.SelectedItem.Value);


            if (bll.Update(model))
            {
                //开始生成缩略图咯

                //AddAdminLog(Vincent._DTcms.DTEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道内容:" + model.title); //记录日志
                result = true;
            }
            return(result);
        }
예제 #5
0
        /*#region 绑定类别=================================
         * private void TreeBind(int _channel_id)
         * {
         *  BLL.article_category bll = new BLL.article_category();
         *  DataTable dt = bll.GetList(0, _channel_id);
         *
         *  this.ddlCategoryId.Items.Clear();
         *  this.ddlCategoryId.Items.Add(new ListItem("请选择类别...", ""));
         *  foreach (DataRow dr in dt.Rows)
         *  {
         *      string Id = dr["id"].ToString();
         *      int ClassLayer = int.Parse(dr["class_layer"].ToString());
         *      string Title = dr["title"].ToString().Trim();
         *
         *      if (ClassLayer == 1)
         *      {
         *          this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
         *      }
         *      else
         *      {
         *          Title = "├ " + Title;
         *          Title = Vincent._DTcms.Utils.StringOfChar(ClassLayer - 1, " ") + Title;
         *          this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
         *      }
         *  }
         * }
         #endregion*/

        #region 赋值操作=================================
        private void ShowInfo(int _id)
        {
            BLL.outlet   bll   = new BLL.outlet();
            Model.outlet model = bll.GetModel(_id);

            provinces.Value  = model.provinces;
            provinces1.Value = model.provinces;
            city.Value       = model.city;
            city1.Value      = model.city;
            area.Value       = model.area;
            area1.Value      = model.area;
            txtaddress.Text  = model.street;//详细地址
            txtTitle.Text    = model.name;
            txtImgUrl.Text   = model.img;
            busintime.Text   = model.busintime;
            txtmobile.Text   = model.mobile;
            txtX.Text        = model.x_zb.ToString();
            txtY.Text        = model.y_zb.ToString();
            TextLinkman.Text = model.Linkman;
            TextWeChat.Text  = model.WeChat;
            TextOther.Text   = model.Other;
        }
예제 #6
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page        = Vincent._DTcms.DTRequest.GetQueryInt("page", 1);
            txtKeywords.Text = this.keywords;

            BLL.outlet bll = new BLL.outlet();

            BuysingooShop.Model.manager manModel = Session[Vincent._DTcms.DTKeys.SESSION_ADMIN_INFO] as Model.manager;

            if (manModel.brand_id != 0)
            {
                _strWhere += " and id=" + manModel.brand_id;
            }
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Vincent._DTcms.Utils.CombUrlTxt("outlet_list.aspx", "status={0}&payment_status={1}&express_status={2}&keywords={3}&page={4}",
                                                             this.status.ToString(), this.payment_status.ToString(), this.express_status.ToString(), this.keywords, "__id__");

            PageContent.InnerHtml = Vincent._DTcms.Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
예제 #7
0
        /// <summary>
        /// 获取订单总金额
        /// </summary>
        /// <param name="total_amount"></param>
        protected void getTotalAmount()
        {
            total_amount  = 0M;
            coupon_amount = 0M;
            refund_amount = 0M;
            if (datetime == null)
            {
                BLL.orders bll = new BLL.orders();
                DataTable  dt;
                if (this.outlet_id > 0)
                {
                    dt = bll.GetOrderAmount(0, " status!=1 and status!=99 and store_id=" + this.outlet_id, " add_time desc,id desc").Tables[0];
                }
                else if (this.city_id > 0)
                {
                    BLL.openarea   open    = new BLL.openarea();
                    Model.openarea openm   = open.GetModel(this.city_id);
                    StringBuilder  strTemp = new StringBuilder();
                    if (openm != null)
                    {
                        BLL.outlet outlet = new BLL.outlet();
                        DataTable  dts    = outlet.GetList(0, " city='" + openm.city + "'", " id").Tables[0];
                        if (dts.Rows.Count > 0)
                        {
                            StringBuilder st = new StringBuilder();
                            string        ss = string.Empty;
                            st.Append("(");
                            foreach (DataRow item in dts.Rows)
                            {
                                st.Append(item["id"] + ",");
                            }
                            if (st.ToString().Trim() != "(")
                            {
                                ss = DelLastComma(st.ToString().Trim());
                                st.Append(")");
                            }
                            strTemp.Append(" and store_id in" + ss + ")");
                        }
                        else
                        {
                            strTemp.Append(" and store_id in(null)");
                        }
                    }
                    dt = bll.GetOrderAmount(0, " status!=1 and status!=99" + strTemp, " add_time desc,id desc").Tables[0];
                }
                else
                {
                    dt = bll.GetOrderAmount(0, " status!=1 and status!=99", " add_time desc,id desc").Tables[0];
                }
                foreach (DataRow row in dt.Rows)
                {
                    total_amount += decimal.Parse(row["order_amount"].ToString());
                    if (row["refund_status"].ToString() != "" && int.Parse(row["refund_status"].ToString()) == 3) //统计退款
                    {
                        refund_amount += decimal.Parse(row["order_amount"].ToString());
                    }
                    BLL.user_coupon_log couponbll = new BLL.user_coupon_log();//统计优惠券
                    if (row["str_code"].ToString() != "")
                    {
                        Model.user_coupon_log couponmodel = couponbll.GetModel(row["str_code"].ToString());
                        if (couponmodel != null && couponmodel.status == 2)
                        {
                            BLL.user_coupon   copbl = new BLL.user_coupon();
                            Model.user_coupon copmo = copbl.GetModel(couponmodel.coupon_id);
                            if (copmo != null)
                            {
                                if (copmo.amount > decimal.Parse(row["order_amount"].ToString()))
                                {
                                    coupon_amount += decimal.Parse(row["order_amount"].ToString());
                                }
                                else
                                {
                                    coupon_amount += copmo.amount;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                BLL.orders bll = new BLL.orders();

                DataTable dt;
                if (this.outlet_id > 0)
                {
                    dt = bll.GetOrderAmount(0, " status!=1 and status!=99 and store_id=" + this.outlet_id, " add_time desc,id desc").Tables[0];
                }
                else
                {
                    dt = bll.GetOrderAmount(0, " status!=1 and status!=99", " add_time desc,id desc").Tables[0];
                }

                //DataTable dt = bll.GetOrderAmount(0, " status!=1 and status!=99 and datediff(dd,add_time,'" + datetime + "')=0", " add_time desc,id desc").Tables[0];
                foreach (DataRow row in dt.Rows)
                {
                    total_amount += decimal.Parse(row["order_amount"].ToString());
                    if (row["refund_status"].ToString() != "" && int.Parse(row["refund_status"].ToString()) == 3)
                    {
                        refund_amount += decimal.Parse(row["order_amount"].ToString());
                    }
                    BLL.user_coupon_log couponbll = new BLL.user_coupon_log();//统计优惠券
                    if (row["str_code"].ToString() != "")
                    {
                        Model.user_coupon_log couponmodel = couponbll.GetModel(row["str_code"].ToString());
                        if (couponmodel != null && couponmodel.status == 2)
                        {
                            BLL.user_coupon   copbl = new BLL.user_coupon();
                            Model.user_coupon copmo = copbl.GetModel(couponmodel.coupon_id);
                            if (copmo != null)
                            {
                                if (copmo.amount > decimal.Parse(row["order_amount"].ToString()))
                                {
                                    coupon_amount += decimal.Parse(row["order_amount"].ToString());
                                }
                                else
                                {
                                    coupon_amount += copmo.amount;
                                }
                            }
                        }
                    }
                }
            }
        }