//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { //ChkAdminLevel("openarea_list", Vincent._DTcms.DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.openarea bll = new BLL.openarea(); 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("openarea_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"); }
/*#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.openarea bll = new BLL.openarea(); Model.openarea model = bll.GetModel(_id); provinces.Value = model.provinces; provinces1.Value = model.provinces; city.Value = model.city; city1.Value = model.city; }
private void CityBind(DropDownList ddl) { BLL.openarea bll = new BLL.openarea(); DataTable dt = bll.GetList(0, "1=1", "id asc").Tables[0]; ddl.Items.Clear(); ddl.Items.Add(new ListItem("请选择城市...", "")); foreach (DataRow dr in dt.Rows) { ddl.Items.Add(new ListItem(dr["city"].ToString(), dr["id"].ToString())); } }
private bool DoEdit(int _id) { bool result = false; Model.openarea model = new Model.openarea(); BLL.openarea bll = new BLL.openarea(); if (this.provinces1.Value == "所在省份") { JscriptMsg("请选择省份!", "", "Error"); return(result); } else if (this.provinces1.Value == "北京市") { model.provinces = this.provinces1.Value; model.city = this.provinces1.Value; } else if (this.provinces1.Value == "天津市") { model.provinces = this.provinces1.Value; model.city = this.provinces1.Value; } else if (this.provinces1.Value == "上海市") { model.provinces = this.provinces1.Value; model.city = this.provinces1.Value; } else if (this.provinces1.Value == "重庆市") { model.provinces = this.provinces1.Value; model.city = this.provinces1.Value; } else { model.provinces = this.provinces1.Value; model.city = this.city1.Value; } model.id = _id; if (bll.Update(model)) { //开始生成缩略图咯 //AddAdminLog(Vincent._DTcms.DTEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道内容:" + model.title); //记录日志 result = true; } return(result); }
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()); }
private void RptBind(string _strWhere, string _orderby) { this.page = Vincent._DTcms.DTRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.openarea bll = new BLL.openarea(); BuysingooShop.Model.manager manModel = Session[Vincent._DTcms.DTKeys.SESSION_ADMIN_INFO] as Model.manager; if (manModel.brand_id != 0) { _strWhere += " and brand_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("openarea_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); }
/// <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; } } } } } } }