Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        //会员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;
        }
Ejemplo n.º 3
0
 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 "无此用户";
     }
 }
Ejemplo n.º 4
0
 /// <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;
     }
 }
Ejemplo n.º 5
0
 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";
 }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
        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());
            }
        }
Ejemplo n.º 8
0
        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);
                            }
                        }

                    }
                }
            }
        }
Ejemplo n.º 9
0
 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;
 }
Ejemplo n.º 10
0
        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();
            }
        }
Ejemplo n.º 11
0
        ///// <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 + "&nbsp;&nbsp;";
                    }
                    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;
        }
Ejemplo n.º 12
0
        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;
            }
        }
Ejemplo n.º 13
0
 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");
     }
 }
Ejemplo n.º 14
0
        /// <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;
        }
Ejemplo n.º 15
0
 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;
 }