/// <summary>
 /// 列表
 /// </summary>
 /// <returns></returns>
 protected string GetList()
 {
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Order.OrderTransfer bll = new ShowShop.BLL.Order.OrderTransfer();
     ChangeHope.DataBase.DataByPage dataPage = bll.GetList();
     //第一步先添加表头
     table.AddHeadCol("", "<input type=\"checkbox\" id=\"chkAll\" onclick=\"CheckAll(this.form)\" alt=\"全选/取消\" />选择");
     table.AddHeadCol("", "订单号");
     table.AddHeadCol("", "前所有者");
     table.AddHeadCol("", "过户给");
     table.AddHeadCol("", "过户费");
     table.AddHeadCol("", "手续费付款人");
     table.AddHeadCol("", "操作人");
     table.AddHeadCol("", "操作时间");
     table.AddRow();
     //添加表的内容
     if (dataPage.DataReader != null)
     {
         while (dataPage.DataReader.Read())
         {
             table.AddCol("<input ID=\"cBox\" type=\"checkbox\" value=\"" + dataPage.DataReader["id"].ToString() + "\" />");
             table.AddCol(dataPage.DataReader["orderid"].ToString());
             table.AddCol(dataPage.DataReader["username"].ToString() == "1" ? "退货" : "发货");
             table.AddCol(dataPage.DataReader["transfername"].ToString());
             table.AddCol(dataPage.DataReader["poundage"].ToString());
             table.AddCol(dataPage.DataReader["poundagepaymentperson"].ToString());
             table.AddCol(dataPage.DataReader["notename"].ToString());
             table.AddCol(dataPage.DataReader["uptime"].ToString());
             table.AddRow();
         }
     }
     string view = table.GetTable() + dataPage.PageToolBar;
     dataPage.Dispose();
     dataPage = null;
     return view;
 }
Пример #2
0
        protected string GetTransList(string orderId)
        {
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            //过户
            ShowShop.BLL.Order.OrderTransfer Bll = new ShowShop.BLL.Order.OrderTransfer();
            ChangeHope.DataBase.DataByPage pageData = Bll.GetList(" 1=1 and orderid='" + orderId + "'");

            //第一步先添加表头
            table.AddHeadCol("", "原属客户");
            table.AddHeadCol("", "先属客户");
            table.AddHeadCol("", "手续费");
            table.AddHeadCol("", "手续费支付者");
            table.AddHeadCol("", "备注/说明");
            table.AddHeadCol("", "操作时间");
            table.AddRow();
            //过户的内容
            if (pageData.DataReader != null)
            {
                while (pageData.DataReader.Read())
                {
                    table.AddCol(pageData.DataReader["username"].ToString());
                    table.AddCol(pageData.DataReader["transfername"].ToString());
                    table.AddCol(pageData.DataReader["poundage"].ToString());
                    table.AddCol(pageData.DataReader["poundagepaymentperson"].ToString());
                    table.AddCol(pageData.DataReader["remark"].ToString());
                    table.AddCol(pageData.DataReader["uptime"].ToString());
                    table.AddRow();
                }
            }
            string view = table.GetTable() + pageData.PageToolBar;
            pageData.Dispose();
            pageData = null;
            return view;
        }
 private void Del(string id)
 {
     ShowShop.BLL.Order.OrderTransfer bll = new ShowShop.BLL.Order.OrderTransfer();
     bll.Delete(id);
     Response.Write("ok");
 }
Пример #4
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;
            }
        }