protected void GetUserID() { int uid = ChangeHope.WebPage.PageRequest.GetQueryInt("uid"); ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = bll.GetModel(uid); txtUserName.Text = model.UserId; ShowShop.Model.Admin.AdminInfo adminModel = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); this.txtAdminName.Text = adminModel.AdminName; }
protected void Page_Load(object sender, EventArgs e) { if(!this.Page.IsPostBack) { ShowShop.Common.PromptInfo.Popedom("008001001"); InitWebControl(); if (ChangeHope.WebPage.PageRequest.GetFormString("Option") != string.Empty && ChangeHope.WebPage.PageRequest.GetFormString("id") != "") { ShowShop.BLL.Member.MemberAccount memberBll = new ShowShop.BLL.Member.MemberAccount(); string types = Request["Option"].Trim(); string id = ChangeHope.WebPage.PageRequest.GetFormString("id"); if (types == "del") { if (ShowShop.Common.PromptInfo.Message("008001003") != "ok") { memberBll.DeleteAll(id); } else { Response.Write("no"); } } if (types == "locked") { if (ShowShop.Common.PromptInfo.Message("008001006") != "ok") { memberBll.LockAddUnLock(id,false); } else { Response.Write("no"); } } if (types == "Unlocked") { if (ShowShop.Common.PromptInfo.Message("008001006") != "ok") { memberBll.LockAddUnLock(id,true); } else { Response.Write("no"); } } Response.End(); return; } GetList(); } }
//会员ID,商品id public static double DiscountedPrice(int memberid, double price, string discountprice) { double reprice = price; try { ShowShop.BLL.Member.MemberAccount memberbll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount membermodel = memberbll.GetModel(memberid); if (membermodel != null) { int level = int.Parse(membermodel.UserGroup.ToString()); ShowShop.BLL.Member.MemberRank rankbll = new ShowShop.BLL.Member.MemberRank(); ShowShop.Model.Member.MemberRank rankmodel = rankbll.GetModel(level); double Discount = 1; if (rankmodel != null) { Discount = Convert.ToDouble(rankmodel.Discount.ToString()); } string[] StrDiscountPrice = discountprice.Split('|'); if (StrDiscountPrice.Length > 0) { for (int i = 0; i < StrDiscountPrice.Length - 1; i++) { string[] DiscountPrice = StrDiscountPrice[i].Split(','); string num = DiscountPrice[0].ToString(); if (Convert.ToInt32(num) == level) { reprice = Convert.ToDouble(DiscountPrice[0].ToString()); break; } else { if (rankmodel != null) { reprice = price * Discount / 100; } } } } else { reprice = price * Discount / 100; } } } catch (Exception ex) { throw ex; } return reprice; }
protected string GetUserIdByuId(int uid) { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = bll.GetModel(uid); if (model != null) { return model.UserId; } else { return "无此用户"; } }
/// <summary> /// 根据账号得到自增ID /// </summary> /// <param name="UserId"></param> /// <returns></returns> protected int GetIdByUserId(string UserId) { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = bll.GetModel(UserId); if (model != null) { return model.UID; } else { return -1; } }
/// <summary> /// 得到初始化时用户的账号串 /// </summary> protected void GetUserID() { string uid = ChangeHope.WebPage.PageRequest.GetQueryString("strId"); string userId = string.Empty; ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); List<ShowShop.Model.Member.MemberAccount> model = bll.GetAll(" UID in(" + uid + ")"); for (int i = 0; i <model.Count; i++) { userId += model[i].UserId + ","; } userId = userId.Substring(0, userId.LastIndexOf(',')); this.txtUserName.Text = userId; }
protected string GetListInfo() { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ChangeHope.DataBase.DataByPage datapage = bll.GetList(); ChangeHope.WebPage.DataTable table = new ChangeHope.WebPage.DataTable(); table.DataReader = datapage.DataReader; table.RowHead = "选择/5%,会员名称/12%,会员类型/8%,会员等级/8%,资金余额/10%,点券/12%,有效期/13%,积分/12%,是否冻结/10%,操作/12%"; table.RowText = "<input type=\"checkbox\" name=\"checkboxid\" value=\"{0}\">$UID,<a href='member_view.aspx?uid={1}'>{0}</a>$UserId|uid,UserTypeContent,UserGroupContent,¥{0}$Capital,{0}点点券$Coupons,PeriodOfValidity,{0}点积分$Points,<script>GetStat('{0}');</script>$state,<a href='#'onclick=\"DelAll({0})\">删除</a> <a href='member_edit.aspx?uid={0}'>编辑</a>$uid"; string view = table.GetDataTable() + datapage.PageToolBar; datapage.Dispose(); datapage = null; table = null; return view; }
protected void lbSave_Click(object sender, EventArgs e) { int uid = ChangeHope.WebPage.PageRequest.GetQueryInt("uid"); if (this.txtEmailContent.Value == string.Empty) { this.ltlMsg.Text = "请输入邮件的内容"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = bll.GetModel(uid); SendByType(model.Email); this.ltlMsg.Text = "操作成功,已向" + model.UserId + "发送该邮件!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; }
protected void MemberBind() { int uid = ChangeHope.WebPage.PageRequest.GetQueryInt("uid"); string outDate = "0"; ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = bll.GetModel(uid); lblUserId.Text = model.UserId; lblGroupName.Text = GetGroupName(Convert.ToInt32(model.UserGroup)); lblCapital.Text = model.Capital.ToString(); lblCoupons.Text = model.Coupons.ToString(); lblPoints.Text = model.Points.ToString(); if (Convert.ToDateTime(model.PeriodOfValidity) > System.DateTime.Now) { TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(model.PeriodOfValidity).Ticks); TimeSpan ts2 = new TimeSpan(DateTime.Now.Ticks); TimeSpan ts = ts1.Subtract(ts2).Duration(); outDate = ts.Days.ToString(); } lblPeriodOfValidity.Text = outDate; lblEmail.Text = model.Email; }
protected void btnSave_Click(object sender, EventArgs e) { if (ViewState["uid"] == null) { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); if (bll.Exists(this.txtUserId.Text.Trim())) { this.ltlMsg.Text = "该用户已经存在"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } try { SaveAccount(); SaveInfo(); } catch (Exception) { this.ltlMsg.Text = "操作失败"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } //if (ViewState["uid"] != null) //{ // this.Response.Redirect("member_edit.aspx?uid=" + ViewState["uid"].ToString()); //} //else //{ // this.ltlMsg.Text = "添加成功,您可以继续添加该用户其它信息,或者返回列表"; // this.pnlMsg.Visible = true; // this.pnlMsg.CssClass = "actionOk"; // return; //} }
/// <summary> /// 发送短消息 /// </summary> /// <param name="uid">用户自增ID</param> /// <param name="userid">用户账号</param> /// <param name="title">短消息标题</param> /// <param name="content">短消息内容</param> /// <param name="sender">发送人(管理员账号)</param> protected void SendMessage(int uid, string userid, string title, string content, string sender) { ShowShop.BLL.Member.MailReceiver ReceBll = new ShowShop.BLL.Member.MailReceiver(); ShowShop.Model.Member.MailReceiver ReceModel = new ShowShop.Model.Member.MailReceiver(); ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); if (!bll.Exists(userid)) { this.ltlMsg.Text = "不存在用户:" + userid; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } ReceModel.ReceiverId = uid; ReceModel.Receiver = userid; ReceModel.ReceiveTime = DateTime.Now; ReceModel.Stat = 0; ReceModel.IsRead = 0; ReceModel.Title = title; ReceModel.Body = content; ReceModel.Sender = sender; ReceBll.Add(ReceModel); }
protected void lbSave_Click(object sender, EventArgs e) { if (ViewState["to"] == null) { this.ltlMsg.Text = "请选择您要移动到的目标会员组"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); List<ShowShop.Model.Member.MemberAccount> model = new List<ShowShop.Model.Member.MemberAccount>(); if (rabtnUser.Checked) { if (txtUserName.Text.Trim().Length != 0) { string uid = this.txtUserName.Text.Trim(); if (uid.EndsWith(",")) { uid = uid.Substring(0, uid.LastIndexOf(',')); } //进行拆分 给每个字段加上单引号 string[] arrUid = uid.Split(','); uid = string.Empty; for (int i = 0; i < arrUid.Length; i++) { uid += "'" + arrUid[i] + "'" + ","; } if (uid.EndsWith(",")) { uid = uid.Substring(0, uid.LastIndexOf(',')); } model = bll.GetAll(" UserId in(" + uid + ")"); for (int i = 0; i < model.Count; i++) { bll.Amend(Convert.ToInt32(model[i].UID), "UserGroup", this.lbxTo.SelectedValue); } this.ltlMsg.Text = "操作成功!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } else { this.ltlMsg.Text = "请输入您要移动的用户"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } //按会员组 批量移动 else if (rabtnGroup.Checked) { if (ViewState["from"] == null) { this.ltlMsg.Text = "请选择您要移动的会员组"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } bll.UpdateGroup(this.lbxFrom.SelectedValue, this.lbxTo.SelectedValue); this.ltlMsg.Text = "操作成功!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } }
private void GetAccount(int uid) { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = bll.GetModel(uid); if (model != null) { ViewState["uid"] = uid.ToString(); this.ddlUserType.SelectedValue = model.UserType.ToString(); this.ddlUserGroup.SelectedValue = model.UserGroup.ToString(); this.txtUserId.Text = model.UserId; this.txtSigned.Text = model.Signed; this.txtQuestion.Text = model.Question; this.txtAnswer.Text = model.Answer; this.txtEmail.Text = model.Email; this.ckbState.Checked = model.State==1?true:false; this.txtUserId.ReadOnly = true; ViewState["RegisterDate"] = model.RegisterDate.ToString(); ViewState["RegisterIP"] = model.RegisterIP.ToString(); ViewState["LastLoginDate"] = model.LastLoginDate.ToString(); ViewState["LastLoginIP"] = model.LastLoginIP.ToString(); ViewState["LoginTimes"] = model.LoginTimes.ToString(); ViewState["Capital"] = model.Capital.ToString(); ViewState["Coupons"] = model.Coupons.ToString(); ViewState["Points"] = model.Points.ToString(); ViewState["PeriodOfValidity"] = model.PeriodOfValidity.ToString(); this.ltlMemberView.Text = "<a href='member_view.aspx?uid=" + model.UID.ToString() + "'>用户详细信息</a>"; } model = null; bll = null; }
private void HandleOrder(int id) { ShowShop.BLL.Order.Orders ordersbll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders ordersModel = ordersbll.GetModel(id); if (ordersModel != null) { ShowShop.BLL.Order.OrderProduct orderProductbll = new ShowShop.BLL.Order.OrderProduct(); DataTable orderProductDT = orderProductbll.GetListOrderProduct(id.ToString()); ShowShop.BLL.Member.MemberAccount memberaccountbll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount memberaccounModel = memberaccountbll.GetModel(ordersModel.UserId); // ShowShop.BLL.Product.ProductSpecification spebll = new ShowShop.BLL.Product.ProductSpecification(); decimal DonateIntegral = 0; if (orderProductDT.Rows.Count > 0) { ShowShop.BLL.Product.ProductInfo productinfoBll = new ShowShop.BLL.Product.ProductInfo(); for (int i = 0; i < orderProductDT.Rows.Count; i++) { ShowShop.Model.Product.ProductInfo productInfoModel = productinfoBll.GetModel(Convert.ToInt32(orderProductDT.Rows[i]["ProId"].ToString())); if (productInfoModel != null) { // DonateIntegral += Convert.ToDecimal(productInfoModel.pro_DonateIntegral); // productinfoBll.Amend(productInfoModel.pro_ID, "pro_SaleNum", productInfoModel.pro_SaleNum + Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())); if (!string.IsNullOrEmpty(orderProductDT.Rows[i]["Specification"].ToString())) { // List<ShowShop.Model.Product.ProductSpecification> spcList = spebll.GetSpecification(" and ProductId=" + orderProductDT.Rows[i]["ProId"].ToString() + " and Specifications='" + orderProductDT.Rows[i]["Specification"].ToString() + "'"); // if (spcList.Count > 0) // { // spebll.Amend(spcList[0].Id, "ProductStock", Convert.ToInt32(spcList[0].ProductStock) - Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())); // } } else { //if (Convert.ToInt32(productInfoModel.pro_Stock) >= Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())) { // productinfoBll.Amend(productInfoModel.pro_ID, "pro_Stock", Convert.ToInt32(productInfoModel.pro_Stock) - Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())); } } } } //购买商品赠送积分 if (memberaccounModel != null) { if (DonateIntegral > 0) { if (memberaccountbll.Amend(memberaccounModel.UID, "Points", memberaccounModel.Points + DonateIntegral) > 0) { ShowShop.BLL.Member.Integral integralBll = new ShowShop.BLL.Member.Integral(); ShowShop.Model.Member.Integral integral = new ShowShop.Model.Member.Integral(); integral.Userid = memberaccounModel.UID; integral.OrderId = ordersModel.OrderId; integral.IntegralClass = 1; integral.IntegralNum = memberaccounModel.Points + DonateIntegral; integral.GainDate = Convert.ToDateTime(System.DateTime.Now); integral.NoteDate = Convert.ToDateTime(System.DateTime.Now); integral.NoteName = "系统"; integral.Remark = "购买商品后赠送的积分"; integral.IntegralStatus = 0; integral.Origin = "订单"; integralBll.Add(integral); } } } } } }
private void OrderInfo(int id) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model=bll.GetModel(id); if (model != null) { ShowShop.BLL.Member.MemberAccount mabll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount mamodel = mabll.GetModel(model.UserId); if (mamodel != null) { this.lbUserName.Text = "<a href='../member/member_view.aspx?uid=" + mamodel.UID + "'>" + model.UserId + "</a>"; } else { this.lbUserName.Text = model.UserId ; } this.lbName.Text = model.ConsigneeName; this.blOrderNo.Text = model.OrderId; ShowShop.Common.OrdersStatusEnum ose = new ShowShop.Common.OrdersStatusEnum(); this.lbOrderStatue.Text = ose.OrderStatus(model.OrderStatus); this.lbLogisticsStatus.Text = ose.OgisticsStatu(model.OgisticsStatus); this.lbPayment.Text = ose.PaymentStatus(model.PaymentStatus); this.lbOrderDateTime.Text = model.OrderDate.ToString(); this.lbConsigneeName.Text = model.ConsigneeName; this.lbConsigneeAddress.Text = model.ConsigneeAddress; this.lbConsigneeEmail.Text = model.ConsigneeEmail; this.lbConsigneeModile.Text = model.ConsigneePhone; this.lbConsigneeTel.Text = model.ConsigneeTel; this.lbConsigneeZip.Text = model.ConsigneeZip; this.lbConstructionSigns.Text = model.ConsigneeRealName; this.lbConsigneTime.Text = model.ConsigneeFax; this.lbPaymentMode.Text = Payments(model.PaymentType); this.lbDeliveryMode.Text = this.Courier(int.Parse(model.Carriage.ToString())); this.lbOrderTotalPrice.Text =Convert.ToDouble(model.FactPrice).ToString("f2"); this.lbCarriage.Text = Convert.ToDouble(model.Courier).ToString("f4"); this.lbpaid.Text = GetPayed(model.OrderId.ToString()); } }
protected void BtnWork_Click(object sender, EventArgs e) { ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); ShowShop.BLL.Member.MemberAccount memberBll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.BLL.Member.UserInfoNote noteBll = new ShowShop.BLL.Member.UserInfoNote(); ShowShop.Model.Member.UserInfoNote noteModel = new ShowShop.Model.Member.UserInfoNote(); if (ViewState["Opreate"].ToString().Equals("add")) { noteModel.BuckleOrAdd = 0; //添加 } else { noteModel.BuckleOrAdd = 1; //减 } noteModel.NoteName = adminInfo.AdminName; noteModel.NoteType = 0;//点卷 noteModel.NoteDate = Convert.ToDateTime(System.DateTime.Now); noteModel.Causation = this.txtWhy.Text.Trim().ToString(); noteModel.BosomNote = this.txtLog.Text.Trim().ToString(); //全部用户 if (ViewState["M"].ToString() == "1") { List<ShowShop.Model.Member.MemberAccount> accountList = memberBll.GetAll(""); foreach (ShowShop.Model.Member.MemberAccount item in accountList) { switch (ViewState["Opreate"].ToString()) { case "add": item.Coupons = Convert.ToDecimal(item.Coupons) + Convert.ToDecimal(this.txtWrap.Text.Trim()); break; case "allay": if (Convert.ToDecimal(this.txtWrap.Text.Trim())<Convert.ToDecimal(item.Coupons) ) { item.Coupons = Convert.ToDecimal(item.Coupons)-Convert.ToDecimal(this.txtWrap.Text.Trim()); } else { this.ltlMsg.Text = "减少的点卷数量大于系统记录的数量!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; default: break; } memberBll.Update(item); noteModel.UserID = Convert.ToInt32(item.UID); noteModel.Username = item.UserId; noteModel.TicketCount = Convert.ToDecimal(this.txtWrap.Text.Trim()); noteBll.Add(noteModel); } } //指定用户组 if (ViewState["M"].ToString() == "2") { //获取会员类型 string typeId = this.cbxlMemberRank.SelectedValue; List<ShowShop.Model.Member.MemberAccount> accountList = merberBll.GetAll("UserGroup=" + typeId); foreach (ShowShop.Model.Member.MemberAccount item in accountList) { switch (ViewState["Opreate"].ToString()) { case "add": item.Coupons = Convert.ToDecimal(item.Coupons) + Convert.ToDecimal(this.txtWrap.Text.Trim()); break; case "allay": if (Convert.ToDecimal(this.txtWrap.Text.Trim()) < Convert.ToDecimal(item.Coupons)) { item.Coupons = Convert.ToDecimal(item.Coupons) - Convert.ToDecimal(this.txtWrap.Text.Trim()); } else { this.ltlMsg.Text = "减少的点卷数量大于系统记录的数量!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; default: break; } memberBll.Update(item); noteModel.UserID = Convert.ToInt32(item.UID); noteModel.Username = item.UserId; noteModel.TicketCount = Convert.ToDecimal(this.txtWrap.Text.Trim()); noteBll.Add(noteModel); } } //指定用户 if (ViewState["M"].ToString() == "3") { string assigner= this.txtName.Text.Trim(); String[] name = assigner.Split(','); int con = name.Length; for (int i = 0; i < con; i++) { string userName = name[i].ToString(); List<ShowShop.Model.Member.MemberAccount> accountList = memberBll.GetAll("UserId = '" + userName + "'"); foreach (ShowShop.Model.Member.MemberAccount item in accountList) { switch (ViewState["Opreate"].ToString()) { case "add": item.Coupons = Convert.ToDecimal(item.Coupons) + Convert.ToDecimal(this.txtWrap.Text.Trim()); break; case "allay": if (Convert.ToDecimal(this.txtWrap.Text.Trim()) < Convert.ToDecimal(item.Coupons)) { item.Coupons = Convert.ToDecimal(item.Coupons) - Convert.ToDecimal(this.txtWrap.Text.Trim()); } else { this.ltlMsg.Text = "减少的点卷数量大于系统记录的数量!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; default: break; } memberBll.Update(item); noteModel.UserID = Convert.ToInt32(item.UID); noteModel.Username = item.UserId; noteModel.TicketCount = Convert.ToDecimal(this.txtWrap.Text.Trim()); noteBll.Add(noteModel); } } } this.ltlMsg.Text = "编辑点卷成功!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; }
protected int GetUidByUserId(string userId) { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = bll.GetModel(userId); return model.UID; }
protected void lbtnSave_Click(object sender, EventArgs e) { /*修改人:YM *修改时间:2009-12-17 *判断订单是否是会员订单及用户是否存在 */ if (this.lblUserName.Text.Trim() == "") { this.ltlMsg.Text = "操作失败!您所支付的订单可能是非会员生成的订单."; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); ShowShop.BLL.Member.MemberAccount memberBll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount memberModel = memberBll.GetModel(this.lblUserName.Text); if (memberModel == null) { this.ltlMsg.Text = "操作失败!该会员不存在."; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } #region 订单预付款资金 ShowShop.Model.Order.PrepayMoney preModel = new ShowShop.Model.Order.PrepayMoney(); ShowShop.BLL.Order.PrepayMoney preBll = new ShowShop.BLL.Order.PrepayMoney(); preModel.OrderId = this.lblOrderId.Text; preModel.UserName = this.lblUserName.Text; preModel.PayoutMoney = Convert.ToDecimal(this.txtPayoutMoney.Text.Trim()); preModel.Remark = this.txtRemark.Text; preModel.BosomNote = this.txtBosomNote.Text; preModel.NoteDate = DateTime.Now; preModel.NoteName = adminInfo.AdminName; #endregion #region 用户交易明细 ShowShop.Model.Member.UserinAndExp userModel = new ShowShop.Model.Member.UserinAndExp(); ShowShop.BLL.Member.UserinAndExp userBll = new ShowShop.BLL.Member.UserinAndExp(); //资金的明细 userModel.UID = memberModel.UID; userModel.AdsumMoneyDate = Convert.ToDateTime(this.txtAdsumMoneyDate.Text); userModel.AdsumMoney = Convert.ToDecimal(this.txtPayoutMoney.Text); userModel.PresentCoupons = 0; userModel.RemitMode = 2; userModel.RemitBank = string.Empty; userModel.Remark = this.txtRemark.Text; userModel.FormMode = string.Empty; //通知方式 userModel.BosomNote = this.txtBosomNote.Text; userModel.NoteDate = DateTime.Now; userModel.NoteName = adminInfo.AdminName; userModel.InComeandExpState = 1; userModel.State = 0; userModel.UserId = this.lblUserName.Text; #endregion #region 订单状态 ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(this.lblOrderId.Text); #endregion ShowShop.BLL.Member.MemberAccount mabll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount mamodel = mabll.GetModel(this.lblUserName.Text); try { //已付款+此次汇款的总和 decimal payTotail = Convert.ToDecimal(this.GetPayed(this.lblOrderId.Text)) + Convert.ToDecimal(this.txtPayoutMoney.Text.Trim()); #region 如果有多余的钱 if (payTotail > Convert.ToDecimal(orderModel.FactPrice)) { ChangeHope.WebPage.BasePage.PageError("输入的金额大于了订单总额!", "order_bank_pay.aspx?OrderId=" + orderModel.Id); return; } #endregion #region 查询用户金额 操作用户金额 if (mamodel != null) { decimal Price = decimal.Parse(mamodel.Capital.ToString()); if (Convert.ToDecimal(this.txtPayoutMoney.Text) > Price) { ChangeHope.WebPage.BasePage.PageError("用户余额不足!", "order_bank_pay.aspx?OrderId=" + orderModel.Id); return; } mabll.Amend(mamodel.UID, "Capital", (Convert.ToDecimal(mamodel.Capital.ToString()) - Convert.ToDecimal(this.txtPayoutMoney.Text))); } #endregion preBll.Add(preModel); userBll.Add(userModel); #region 操作付款状态 订单状态 int OrderId = ChangeHope.WebPage.PageRequest.GetQueryInt("OrderId"); if (payTotail >= Convert.ToDecimal(orderModel.FactPrice)) { if (OrderId > 0) { orderBll.Amend(OrderId, "OrderStatus", ShowShop.Common.OrdersStatusEnum.OrderStatu.未结清.GetHashCode()); orderBll.Amend(OrderId, "PaymentStatus", ShowShop.Common.OrdersStatusEnum.PaymentStatu.已经付清.GetHashCode()); orderBll.Amend(OrderId, "OgisticsStatus", ShowShop.Common.OrdersStatusEnum.OgisticsStatus.配送中.GetHashCode()); } } else { if (OrderId > 0) { orderBll.Amend(OrderId, "OrderStatus", ShowShop.Common.OrdersStatusEnum.OrderStatu.未结清.GetHashCode()); orderBll.Amend(OrderId, "PaymentStatus", ShowShop.Common.OrdersStatusEnum.PaymentStatu.未付清.GetHashCode()); } } #endregion ChangeHope.WebPage.BasePage.PageRight("已保存该信息", "order_bank_pay.aspx?OrderId=" + orderModel.Id); } catch { this.ltlMsg.Text = "操作失败!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } finally { adminInfo = null; preModel = null; preBll = null; orderBll = null; orderModel = null; GC.Collect(); } }
//批量事件(添加与减少) protected void BtnWork_Click(object sender, EventArgs e) { ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); ShowShop.BLL.Member.MemberAccount memberBll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.BLL.Member.UserInfoNote noteBll = new ShowShop.BLL.Member.UserInfoNote(); ShowShop.Model.Member.UserInfoNote noteModel = new ShowShop.Model.Member.UserInfoNote(); if (ViewState["Opreate"].ToString().Equals("add")) { noteModel.BuckleOrAdd = 0; //添加 } else { noteModel.BuckleOrAdd = 1; //减少 } noteModel.NoteName = adminInfo.AdminName; noteModel.NoteType = 2; noteModel.NoteDate = Convert.ToDateTime(System.DateTime.Now.ToShortDateString()); noteModel.Causation = this.txtWhy.Text.Trim().ToString(); noteModel.BosomNote = this.txtLog.Text.Trim().ToString(); //所有会员 if (ViewState["M"].ToString() == "1") { List <ShowShop.Model.Member.MemberAccount> accountList= memberBll.GetAll(""); foreach (ShowShop.Model.Member.MemberAccount item in accountList) { TimeSpan oldtime = new TimeSpan(Convert.ToDateTime(item.PeriodOfValidity).Ticks); if (ViewState["time"].ToString() == "4") { switch (ViewState["Opreate"].ToString()) { case "add": if (Convert.ToDateTime(this.txtManageTime.Text) > Convert.ToDateTime(item.PeriodOfValidity)) { item.PeriodOfValidity = Convert.ToDateTime(this.txtManageTime.Text); } else { this.ltlMsg.Text = "添加的有效期小于系统记录的有效期!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; case "allay": if (Convert.ToDateTime(this.txtManageTime.Text) < Convert.ToDateTime(item.PeriodOfValidity)) { item.PeriodOfValidity = Convert.ToDateTime(this.txtManageTime.Text); } else { this.ltlMsg.Text = "减少的有效期大于系统记录的有效期!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; default: break; } } else { //归0 item.PeriodOfValidity = Convert.ToDateTime(System.DateTime.Now.ToShortDateString()); } memberBll.Update(item); TimeSpan newtime=new TimeSpan(Convert.ToDateTime(this.txtManageTime.Text).Ticks); TimeSpan gap=oldtime.Subtract(newtime).Duration(); noteModel.TicketCount=Convert.ToDecimal(gap.Days); noteModel.UserID = Convert.ToInt32(item.UID); noteModel.Username = item.UserId; noteBll.Add(noteModel); } } //指定会员组 if (ViewState["M"].ToString() == "2") { //获取会员类型 string typeId = this.cbxlMemberRank.SelectedValue; List<ShowShop.Model.Member.MemberAccount> accountList = merberBll.GetAll("UserGroup="+typeId); foreach (ShowShop.Model.Member.MemberAccount item in accountList) { TimeSpan oldtime = new TimeSpan(Convert.ToDateTime(item.PeriodOfValidity).Ticks); if (ViewState["time"].ToString() == "4") { switch (ViewState["Opreate"].ToString()) { case "add": if (Convert.ToDateTime(this.txtManageTime.Text) > Convert.ToDateTime(item.PeriodOfValidity)) { item.PeriodOfValidity = Convert.ToDateTime(this.txtManageTime.Text); } else { this.ltlMsg.Text = "添加的有效期小于系统记录的有效期!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; case "allay": if (Convert.ToDateTime(this.txtManageTime.Text) < Convert.ToDateTime(item.PeriodOfValidity)) { item.PeriodOfValidity = Convert.ToDateTime(this.txtManageTime.Text); } else { this.ltlMsg.Text = "减少的有效期大于系统记录的有效期!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; default: break; } } else { //归0 item.PeriodOfValidity = Convert.ToDateTime(System.DateTime.Now.ToShortDateString()); } memberBll.Update(item); TimeSpan newtime = new TimeSpan(Convert.ToDateTime(this.txtManageTime.Text).Ticks); TimeSpan gap = oldtime.Subtract(newtime).Duration(); noteModel.TicketCount = Convert.ToDecimal(gap.Days); noteModel.UserID = Convert.ToInt32(item.UID); noteModel.Username = item.UserId; noteBll.Add(noteModel); } } //指定用户 if(ViewState["M"].ToString() =="3") { string assigner= this.txtName.Text.Trim(); String[] name = assigner.Split(','); int con = name.Length; for (int i = 0; i < con; i++) { string userName = name[i].ToString(); List<ShowShop.Model.Member.MemberAccount> accountList = memberBll.GetAll("UserId = '" + userName + "'"); foreach (ShowShop.Model.Member.MemberAccount item in accountList) { TimeSpan oldtime = new TimeSpan(Convert.ToDateTime(item.PeriodOfValidity).Ticks); if (ViewState["time"].ToString() == "4") { switch (ViewState["Opreate"].ToString()) { case "add": if (Convert.ToDateTime(this.txtManageTime.Text) > Convert.ToDateTime(item.PeriodOfValidity)) { item.PeriodOfValidity = Convert.ToDateTime(this.txtManageTime.Text); } else { this.ltlMsg.Text = "添加的有效期小于系统记录的有效期!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; case "allay": if (Convert.ToDateTime(this.txtManageTime.Text) < Convert.ToDateTime(item.PeriodOfValidity)) { item.PeriodOfValidity = Convert.ToDateTime(this.txtManageTime.Text); } else { this.ltlMsg.Text = "减少的有效期大于系统记录的有效期!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } break; default: break; } } else { //归0 item.PeriodOfValidity = Convert.ToDateTime(System.DateTime.Now.ToShortDateString()); } memberBll.Update(item); TimeSpan newtime = new TimeSpan(Convert.ToDateTime(this.txtManageTime.Text).Ticks); TimeSpan gap = oldtime.Subtract(newtime).Duration(); noteModel.TicketCount = Convert.ToDecimal(gap.Days); noteModel.UserID = Convert.ToInt32(item.UID); noteModel.Username = item.UserId; noteBll.Add(noteModel); } } } this.ltlMsg.Text = "编辑有效期成功!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; }
private void OrderInfo(int id) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(id); this.hlBackList.NavigateUrl = "order_order_info.aspx?OrderId=" + id; ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter(); this.txtProductName.Attributes.Add("readonly", "readonly"); this.txtProductName.Attributes.Add("onclick", "selectFile('Product',new Array(" + this.hfid.ClientID + "," + this.txtProductName.ClientID + "),310,550,'" + sp.DummyPaht + "');"); if (model != null) { ShowShop.BLL.Member.MemberAccount mabll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount mamodel = mabll.GetModel(model.UserId); if (mamodel != null) { ShowShop.BLL.Member.MemberInfo mibll = new ShowShop.BLL.Member.MemberInfo(); ShowShop.Model.Member.MemberInfo mimodel = mibll.GetModel(mamodel.UID); if (mimodel != null) { this.lbName.Text = mimodel.TrueName; } this.lbUserName.Text = "<a href='../member/member_view.aspx?uid=" + mamodel.UID + "'>" + model.UserId + "</a>"; } else { this.lbUserName.Text = model.UserId; } this.paymentInfo(model.SaleUserType, model.SaleUserID); this.hfOrderId.Value = id.ToString(); this.blOrderNo.Text = model.OrderId; ShowShop.Common.OrdersStatusEnum ose = new ShowShop.Common.OrdersStatusEnum(); this.lbOrderStatue.Text = ose.OrderStatus(model.OrderStatus); this.lbLogisticsStatus.Text = ose.OgisticsStatu(model.OgisticsStatus); this.lbPayment.Text = ose.PaymentStatus(model.PaymentStatus); this.lbOrderDateTime.Text = model.OrderDate.ToString(); this.txtConsigneeName.Text = model.ConsigneeName; this.txtConsigneeAddress.Text = model.ConsigneeAddress; this.txtConsigneeEmail.Text = model.ConsigneeEmail; this.txtConsigneeModile.Text = model.ConsigneePhone; this.txtConsigneeTel.Text = model.ConsigneeTel; this.txtConsigneeZip.Text = model.ConsigneeZip; this.txtConstructionSigns.Text = model.ConsigneeRealName; this.txtConsigneTime.Text = model.ConsigneeFax; this.txtRemark.Text = string.IsNullOrEmpty(model.Remark) ? "" : model.Remark; this.ddlPayMent.SelectedValue = model.PaymentType.ToString(); this.ddlDeliver.SelectedValue = model.Carriage.ToString(); this.lbOrderTotalPrice.Text =Convert.ToDouble(model.FactPrice).ToString("f2"); this.txtCarriage.Text = Convert.ToDouble(model.Courier).ToString("f2"); } }
///// <summary> ///// 列表 ///// </summary> ///// <returns></returns> protected string GetList() { ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table(); ShowShop.BLL.SystemInfo.PostArea bll = new ShowShop.BLL.SystemInfo.PostArea(); ChangeHope.DataBase.DataByPage dataPage=null; //从url获取配送方式ID idform = ChangeHope.WebPage.PageRequest.GetQueryInt("delivermode"); this.HyperLink1.NavigateUrl = "deliver_edit.aspx?delivermode=" + idform.ToString(); if (idform != 0 && idform != -1) { dataPage = bll.GetAreasByPostMethod(this.idform); } else { dataPage = bll.GetAreasByPostMethod(this.idform); } //第一步先添加表头 table.AddHeadCol("5%", "序号"); table.AddHeadCol("20%", "配送区域名称"); table.AddHeadCol("18%", "配送方式"); table.AddHeadCol("", "配送区域"); table.AddHeadCol("", "发布人"); table.AddHeadCol("10%", "操作"); table.AddRow(); //添加表的内容 if (dataPage.DataReader != null) { int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex"); if (curpage < 0) { curpage = 1; } int count = 0; while (dataPage.DataReader.Read()) { count++; string No = (15 * (curpage - 1) + count).ToString(); table.AddCol(No); table.AddCol(dataPage.DataReader["AreaName"].ToString()); //根据ID查询配送方式名称 ShowShop.BLL.SystemInfo.Deliver deliverbll = new ShowShop.BLL.SystemInfo.Deliver(); ShowShop.Model.SystemInfo.Deliver modeldeli = deliverbll.GetModelByID(int.Parse(dataPage.DataReader["DeliveryMode"].ToString())); table.AddCol(modeldeli.Distributionname); //根据ID查询城市名称 ShowShop.BLL.SystemInfo.Provinces areaid = new ShowShop.BLL.SystemInfo.Provinces(); ShowShop.Model.SystemInfo.Provinces modelpro; string citys = ""; string[] arr = dataPage.DataReader["AreaId"].ToString().Split(','); foreach(string i in arr) { modelpro=areaid.GetModel(int.Parse(i)); citys += modelpro.CityName + " "; } table.AddCol(citys); string userName = ""; if (dataPage.DataReader["putouttyid"].ToString() == "0") { userName = "******"; } else { if (dataPage.DataReader["putoutid"].ToString() != "") { ShowShop.BLL.Member.MemberAccount memberbll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount member = memberbll.GetModel(Convert.ToInt32(dataPage.DataReader["putoutid"].ToString())); if (member != null) { userName = "******" + member.UserId.ToString(); } } } table.AddCol(userName); table.AddCol(string.Format("<a href=deliver_edit.aspx?delivermode={0}&areaid={1}>编辑</a> <a href='javascript:void(0)' onclick='Del({1})'>删除</a>", dataPage.DataReader["DeliveryMode"].ToString(), dataPage.DataReader["Id"].ToString())); table.AddRow(); } } string view = table.GetTable() + dataPage.PageToolBar; dataPage.Dispose(); dataPage = null; return view; }
private void SaveAccount() { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount model = new ShowShop.Model.Member.MemberAccount(); model.UserGroup = ChangeHope.Common.StringHelper.StringToInt(this.ddlUserGroup.SelectedValue); model.UserId = this.txtUserId.Text; model.UserType = ChangeHope.Common.StringHelper.StringToInt(this.ddlUserType.SelectedValue); model.State = this.ckbState.Checked ? 1 : 0; model.Signed = this.txtSigned.Text; model.Question = this.txtQuestion.Text; model.PassWord = this.txtPassword.Text; model.Answer = txtAnswer.Text; model.Email = txtEmail.Text; if (ViewState["uid"] != null) { model.UID = Convert.ToInt32(ViewState["uid"].ToString()); model.RegisterDate = Convert.ToDateTime(ViewState["RegisterDate"].ToString()); model.RegisterIP = ViewState["RegisterIP"].ToString(); model.LastLoginDate = Convert.ToDateTime(ViewState["LastLoginDate"].ToString()); model.LastLoginIP = ViewState["LastLoginIP"].ToString(); model.LoginTimes = Convert.ToInt32(ViewState["LoginTimes"].ToString()); model.Capital = Convert.ToDecimal(ViewState["Capital"].ToString()); model.Coupons = Convert.ToDecimal(ViewState["Coupons"].ToString()); model.Points = Convert.ToDecimal(ViewState["Points"].ToString()); model.PeriodOfValidity = Convert.ToDateTime(ViewState["PeriodOfValidity"].ToString()); bll.Update(model); } else { model.RegisterDate = DateTime.Now; model.RegisterIP = Request.UserHostAddress; model.LastLoginDate = DateTime.Now; model.LastLoginIP = Request.UserHostAddress; model.LoginTimes = 0; model.Capital = 0; model.Coupons = 0; model.Points = 0; model.PeriodOfValidity = DateTime.Now; bll.Add(model); } }
private void GetInfo(int uid) { ShowShop.BLL.Member.MemberInfo bll = new ShowShop.BLL.Member.MemberInfo(); ShowShop.Model.Member.MemberInfo model = null; try { model = bll.GetModel(uid); if (model != null) { this.lblTrueName.Text = model.TrueName + "(籍贯:" + model.Origin + ")"; this.lblTitle.Text = model.Title; this.lblBirthday.Text = (model.Birthday != null ? (((DateTime)model.Birthday).ToString("yyyy-MM-dd")) : ("未填写")); this.lblPapersType.Text = ChangeHope.DataBase.DataHelper.GetContent("yxs_code_papers", model.PapersType); this.lblPapersNumber.Text = model.PapersNumber; this.lblNation.Text = model.Nation; this.lblSex.Text = ChangeHope.DataBase.DataHelper.GetContent("yxs_code_sex", model.Sex.ToString()); this.lblMarriage.Text = ChangeHope.DataBase.DataHelper.GetContent("yxs_code_marriage", model.Marriage.ToString()); this.lblEducation.Text = ChangeHope.DataBase.DataHelper.GetContent("yxs_code_education", model.Education); this.lblGraduateSchool.Text = model.GraduateSchool; //获取省信息 string province = ""; ShowShop.BLL.SystemInfo.Provinces bllProvinces = new ShowShop.BLL.SystemInfo.Provinces(); Model.SystemInfo.Provinces modelProvinces = bllProvinces.GetModel(ChangeHope.Common.StringHelper.StringToInt(model.Province)); if (modelProvinces != null) { province = modelProvinces.CityName; } modelProvinces = bllProvinces.GetModel(ChangeHope.Common.StringHelper.StringToInt(model.City)); if (modelProvinces != null) { province = province + "." + modelProvinces.CityName; } modelProvinces = bllProvinces.GetModel(ChangeHope.Common.StringHelper.StringToInt(model.Borough)); if (modelProvinces != null) { province = province + "." + modelProvinces.CityName; } this.lblProvince.Text = province; this.lblAddress.Text = model.Address; this.lblZip.Text = model.Zip; this.lblOfficePhone.Text = model.OfficePhone; this.lblHomePhone.Text = model.HomePhone; this.lblMobilePhone.Text = model.MobilePhone; this.lblHandPhone.Text = model.HandPhone; this.lblFax.Text = model.Fax; this.lblPersonWebSite.Text = model.PersonWebSite; this.lblQQ.Text = model.QQ; this.lblMSN.Text = model.MSN; this.lblICQ.Text = model.ICQ; this.lblUC.Text = model.UC; this.lblLifeHobbies.Text = model.LifeHobbies; this.lblCultureHobbies.Text = model.CultureHobbies; this.lblEntertainment.Text = model.Entertainment; this.lblSportsHobbies.Text = model.SportsHobbies; this.lblOtherHobbies.Text = model.OtherHobbies; this.lblIncName.Text = model.IncName; this.lblDepartment.Text = model.Department; this.lblPositions.Text = model.Positions; this.lblWorkRange.Text = model.WorkRange; this.lblIncAddress.Text = model.IncAddress; this.lblMonthlyInCome.Text = model.MonthlyInCome + " 元人民币"; } } catch { } finally { model = null; bll = null; } }
private void GetAccount(int uid) { ShowShop.Model.Member.MemberAccount model = bll.GetModel(uid); if (model != null) { this.ltlUser.Text = "【"+model.UserId+"】"; this.lblUserType.Text = ChangeHope.DataBase.DataHelper.GetContent("yxs_code_usertype", model.UserType.ToString()); this.lblUserGroup.Text = ChangeHope.DataBase.DataHelper.GetContent("yxs_memberrank", "Id", "Name", model.UserGroup.ToString()); this.lblUserId.Text = model.UserId; this.lblEmail.Text = model.Email; this.lblState.Text = model.State==1?"被冻结":"正常"; this.lblRegisterDate.Text = model.RegisterDate.ToString(); this.lblRegisterIP.Text = model.RegisterIP; this.lblLastLoginDate.Text = model.LastLoginDate.ToString(); this.lblLastLoginIP.Text = model.LastLoginIP; this.lblCapital.Text = model.Capital.ToString(); this.lblCoupons.Text = model.Coupons.ToString(); this.lblPoints.Text = model.Points.ToString(); this.lblPeriodOfValidity.Text = model.PeriodOfValidity.ToString(); } model = null; bll = null; }
private void SaveInfo() { ShowShop.BLL.Member.MemberAccount abll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.BLL.Member.MemberInfo bll = new ShowShop.BLL.Member.MemberInfo(); Model.Member.MemberInfo model = new ShowShop.Model.Member.MemberInfo(); try { model.PrivacySettings = ckbPrivacySettings.Checked?1:0; model.TrueName = txtTrueName.Text; model.Title = txtTitle.Text; model.Photo = "";//txtPhoto.Text; model.Birthday = ChangeHope.Common.StringHelper.StringToDateTime(txtBirthday.Text); model.PapersType = ddlPapersType.SelectedValue; model.PapersNumber = txtPapersNumber.Text; model.Origin = txtOrigin.Text; model.Nation = txtNation.Text; model.Sex = ChangeHope.Common.StringHelper.StringToInt(ddlSex.SelectedValue); model.Marriage = ChangeHope.Common.StringHelper.StringToInt(ddlMarriage.SelectedValue); model.Education = ddlEducation.SelectedValue; model.GraduateSchool = txtGraduateSchool.Text; model.Province = ChangeHope.WebPage.PageRequest.GetFormString("ctl00$workspace$ddlProvince"); model.City = ChangeHope.WebPage.PageRequest.GetFormString("ctl00$workspace$ddlCity"); model.Borough = ChangeHope.WebPage.PageRequest.GetFormString("ctl00$workspace$ddlBorough"); model.Address = txtAddress.Text; /*kevin 12.12 修改*/ if (txtZip.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsSend(txtZip.Text.Trim())) { this.ltlMsg.Text = "请输入正确的邮政编码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } if (txtOfficePhone.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsPhone(txtOfficePhone.Text)) { this.ltlMsg.Text = "请输入正确的电话号码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } if (txtMobilePhone.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsMobilePhone(txtMobilePhone.Text)) { this.ltlMsg.Text = "请输入正确的手机号码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } if (txtHomePhone.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsPhone(txtHomePhone.Text)) { this.ltlMsg.Text = "请输入正确的住宅电话号码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } if (txtHandPhone.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsPhone(txtHandPhone.Text)) { this.ltlMsg.Text = "请输入正确的小灵通号码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } if (txtFax.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsPhone(txtFax.Text)) { this.ltlMsg.Text = "请输入正确的传真号码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } if (txtQQ.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsNumber(txtQQ.Text) || txtQQ.Text.Length < 5 || txtQQ.Text.Length > 13) { this.ltlMsg.Text = "请输入正确的QQ号码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } if (txtUC.Text != "") { if (!ChangeHope.Common.ValidateHelper.IsNumber(txtUC.Text) || txtUC.Text.Length < 5 || txtUC.Text.Length > 13) { this.ltlMsg.Text = "请输入正确的UC号码"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } } model.Zip = txtZip.Text; model.OfficePhone = txtOfficePhone.Text; model.HomePhone = txtHomePhone.Text; model.MobilePhone = txtMobilePhone.Text; model.HandPhone = txtHandPhone.Text; model.Fax = txtFax.Text; model.PersonWebSite = txtPersonWebSite.Text; model.QQ = txtQQ.Text; model.MSN = txtMSN.Text; model.ICQ = txtICQ.Text; model.UC = txtUC.Text; model.LifeHobbies = txtLifeHobbies.Text; model.CultureHobbies = txtCultureHobbies.Text; model.Entertainment = txtEntertainment.Text; model.SportsHobbies = txtSportsHobbies.Text; model.OtherHobbies = txtOtherHobbies.Text; model.IncName = txtIncName.Text; model.Department = txtDepartment.Text; model.Positions = txtPositions.Text; model.WorkRange = txtWorkRange.Text; model.IncAddress = txtIncAddress.Text; model.MonthlyInCome = txtMonthlyInCome.Text; if (bll.Exists(Convert.ToInt32(ViewState["uid"].ToString())) && ViewState["uid"] != null) { model.UID = Convert.ToInt32(ViewState["uid"].ToString()); bll.Update(model); } else { model.UID = GetIdByUserId(this.txtUserId.Text.Trim()); bll.Add(model); } this.ltlMsg.Text = "编辑信息成功"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } catch { } finally { model = null; bll = null; } }
/// <summary> /// 获取列表 /// </summary> private void GetList() { ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter(); ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table(); ShowShop.BLL.Order.ShoppingCard data = new ShowShop.BLL.Order.ShoppingCard(); ChangeHope.DataBase.DataByPage dataPage = data.GetCartProduct(ChangeHope.WebPage.PageRequest.GetString("q_uniqueid")); //第一步先添加表头 table.AddHeadCol("5%", "序号"); table.AddHeadCol("35%", "商品名称"); table.AddHeadCol("10%", "购买数量"); table.AddHeadCol("10%", "单价"); table.AddHeadCol("25%", "购买时间"); table.AddHeadCol("10%", "小计"); //table.AddHeadCol("5%", "操作"); table.AddRow(); //添加表的内容 if (dataPage.DataReader != null) { string userName = ChangeHope.WebPage.PageRequest.GetString("UserName"); string userId = string.Empty; ShowShop.BLL.Member.MemberAccount mabll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount mamodel = mabll.GetModel(userName); if (mamodel != null) { userId = mamodel.UID.ToString(); } int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex"); if (curpage < 0) { curpage = 1; } int count = 0; // YXShop.TemplateAction.Common dp = new YXShop.TemplateAction.Common(); double totalPrice=0; while (dataPage.DataReader.Read()) { double price = 0.0; price = double.Parse(dataPage.DataReader["pro_ShopPrice"].ToString()); if (userId != string.Empty) { price =ShowShop.Common.ProductInfo.DiscountedPrice(Convert.ToInt32(userId), price, dataPage.DataReader["pro_RatingDiscount"].ToString()); } /* *修改人:ym *修改时间:2009.10.09 */ int procount = int.Parse(dataPage.DataReader["quantity"].ToString()); double total = price * procount; totalPrice+=total; count++; string No = (15 * (curpage - 1) + count).ToString(); table.AddCol(No); table.AddCol(string.Format("<a href='" + sp.DummyPaht + "product/productcontent.aspx?q_productid={1}' target=\"_blank\">{0}</a>", dataPage.DataReader["pro_Name"].ToString(), dataPage.DataReader["pro_Id"].ToString())); table.AddCol(dataPage.DataReader["quantity"].ToString()); table.AddCol(dataPage.DataReader["pro_ShopPrice"].ToString()); table.AddCol(dataPage.DataReader["addtime"].ToString()); table.AddCol(total.ToString()); table.AddRow(); } this.lbTotal.Text = "本页合计:" + totalPrice; } string view = table.GetTable() + dataPage.PageToolBar; dataPage.Dispose(); dataPage = null; this.ltlList.Text = view; }
protected void lbSave_Click(object sender, EventArgs e) { ShowShop.BLL.Member.MemberAccount bll = new ShowShop.BLL.Member.MemberAccount(); List<ShowShop.Model.Member.MemberAccount> model = new List<ShowShop.Model.Member.MemberAccount>(); //发送给全体 if (rabtnAllUser.Checked) { model = bll.GetAll(" 1=1"); for (int i = 0; i < model.Count; i++) { SendByType(model[i].Email); } this.ltlMsg.Text = "操作成功,已向所有用户发送该邮件!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } //发送会员组 else if (rabtnMemberGroup.Checked) { string rankID = string.Empty; for (int i = 0; i < cbxlMemberRank.Items.Count; i++) { if (cbxlMemberRank.Items[i].Selected) { rankID += cbxlMemberRank.Items[i].Value + ","; } } if (rankID == string.Empty) { this.ltlMsg.Text = "请选择要发送到的会员组"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } rankID = rankID.Substring(0, rankID.LastIndexOf(',')); model = bll.GetAll(" UserGroup in(" + rankID + ")"); for (int i = 0; i < model.Count; i++) { SendByType(model[i].Email); } this.ltlMsg.Text = "操作成功,已向指定用户组发送该邮件!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } //指定用户名 else if (rabtnCheckUser.Checked) { string uid = this.txtUserName.Text.Trim(); if (uid.Length == 0) { this.ltlMsg.Text = "请输入要发送到的会员"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } if (uid.EndsWith(",")) { uid = uid.Substring(0, uid.LastIndexOf(',')); } //进行拆分 给每个字段加上单引号 string[] arrUid = uid.Split(','); uid = string.Empty; for (int i = 0; i < arrUid.Length; i++) { uid += "'" + arrUid[i] + "'" + ","; } if (uid.EndsWith(",")) { uid = uid.Substring(0, uid.LastIndexOf(',')); } model = bll.GetAll(" UserId in(" + uid + ")"); for (int i = 0; i < model.Count; i++) { SendByType(model[i].Email); } this.ltlMsg.Text = "操作成功,已向指定用户发送该邮件!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } //指定邮箱 else if (rabtnCheckEmail.Checked) { string email = this.txtEmail.Text.Trim(); if (email.Length == 0) { this.ltlMsg.Text = "请输入要发送到的邮箱"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } SendByType(email); this.ltlMsg.Text = "操作成功,已向所有用户发送该邮件!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } }
protected void lbtnSave_Click(object sender, EventArgs e) { ShowShop.BLL.Member.MemberAccount memberBll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(this.lblOrderId.Text); decimal memberCapital = 0; ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); if (!memberBll.Exists(this.txtTransferName.Text.Trim())) { this.ltlMsg.Text = "过户失败,不存在用户:" + this.txtTransferName.Text.Trim(); this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } ShowShop.BLL.Order.OrderTransfer bll = new ShowShop.BLL.Order.OrderTransfer(); ShowShop.Model.Order.OrderTransfer model = new ShowShop.Model.Order.OrderTransfer(); model.OrderId = this.lblOrderId.Text; model.UserName = this.lblUserName.Text; model.TransferName = this.txtTransferName.Text; model.PoundAge = Convert.ToDecimal(this.txtPoundAge.Text); model.Remark = this.txtRemark.Text; model.NoteDate = DateTime.Now; model.NoteName = adminInfo.AdminName; model.UpTime = DateTime.Now; #region 计算用户余额 是否能支付过户费 if (this.rabPoundPay.SelectedValue == "0") //订单当前所有者 支付手续费 { ShowShop.Model.Member.MemberAccount memberModel = memberBll.GetModel(this.lblUserId.Text.Trim()); if (memberModel.Capital > Convert.ToDecimal(this.txtPoundAge.Text)) { memberCapital = Convert.ToDecimal(memberModel.Capital - Convert.ToDecimal(this.txtPoundAge.Text)); } else { this.ltlMsg.Text = "过户失败," + this.lblUserId.Text.Trim() + " 资金余额不足"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } //更改用户资金状况 memberBll.Amend(memberModel.UID, "Capital", memberCapital); model.PoundAgePayMentPerson = this.lblUserId.Text; } else //过户对象 { ShowShop.Model.Member.MemberAccount memberModel = memberBll.GetModel(this.txtTransferName.Text.Trim()); if (memberModel.Capital > Convert.ToDecimal(this.txtPoundAge.Text)) { memberCapital = Convert.ToDecimal(memberModel.Capital - Convert.ToDecimal(this.txtPoundAge.Text)); } else { this.ltlMsg.Text = "过户失败," + this.txtTransferName.Text.Trim() + " 资金余额不足"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } //更改用户资金状况 memberBll.Amend(memberModel.UID, "Capital", memberCapital); model.PoundAgePayMentPerson = this.txtTransferName.Text; } #endregion try { //把原订单所属用户改为现在的用户 orderModel.UserId = this.txtTransferName.Text.Trim(); orderBll.Update(orderModel); bll.Add(model); this.ltlMsg.Text = "操作成功,已保存该信息"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } catch { this.ltlMsg.Text = "操作失败!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } finally { bll = null; model = null; } }