/// <summary>
 /// 列表
 /// </summary>
 /// <returns></returns>
 protected string GetList()
 {
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Order.ConsignMent bll = new ShowShop.BLL.Order.ConsignMent();
     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.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["consignmenttype"].ToString() == "1" ? "退货" : "发货");
             table.AddCol(dataPage.DataReader["username"].ToString());
             table.AddCol(dataPage.DataReader["expresscompany"].ToString());
             table.AddCol(dataPage.DataReader["expressoddnumbers"].ToString());
             table.AddCol(dataPage.DataReader["notename"].ToString());
             table.AddCol(dataPage.DataReader["consignmentpeople"].ToString());
             table.AddCol(string.Format("<img src='../images/{0}.gif' alt=''/>", dataPage.DataReader["received"].ToString()));
             table.AddRow();
         }
     }
     string view = table.GetTable() + dataPage.PageToolBar;
     dataPage.Dispose();
     dataPage = null;
     return view;
 }
        protected string GetConsignList(string orderId)
        {
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            //发货
            ShowShop.BLL.Order.ConsignMent Bll = new ShowShop.BLL.Order.ConsignMent();
            ChangeHope.DataBase.DataByPage pageData = Bll.GetList(" 1=1 and orderid='" + orderId + "'");

            //第一步先添加表头
            table.AddHeadCol("", "客户名称");
            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["consignmentdate"].ToString());
                    table.AddCol(pageData.DataReader["expresscompany"].ToString());
                    table.AddCol(pageData.DataReader["expressoddnumbers"].ToString());
                    table.AddCol(pageData.DataReader["consignmentpeople"].ToString());
                    table.AddCol(pageData.DataReader["remark"].ToString());
                    table.AddCol(pageData.DataReader["consignmenttype"].ToString() == "0" ? "发货" : "退货");
                    table.AddRow();
                }
            }
            string view = table.GetTable() + pageData.PageToolBar;
            pageData.Dispose();
            pageData = null;
            return view;
        }
        protected void lbtnSave_Click(object sender, EventArgs e)
        {
            ShowShop.Model.Order.ConsignMent model = new ShowShop.Model.Order.ConsignMent();
            ShowShop.BLL.Order.ConsignMent bll = new ShowShop.BLL.Order.ConsignMent();
            ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get();
            model.OrderId = this.lblOrderId.Text;
            model.UserName = this.lblUserName.Text;
            model.ConsignMentDate = Convert.ToDateTime(this.txtConsignMentDate.Text);
            model.ExpressCompany = this.ddlExpressCompany.SelectedItem.Text;
            model.ExpressOddNumbers = this.txtExpressOddNumbers.Text;
            model.ConsignMentPeople = this.txtConsignMentPeople.Text;
            model.Remark = this.txtRemark.Text;
            model.BosomNote = this.txtBosomNote.Text;
            model.InformMode = GetInforMode(cbxInformMode)["txt"]; //通知方式
            model.NoteDate = DateTime.Now;
            model.NoteName = adminInfo.AdminName;
            model.Received = ShowShop.Common.OrdersStatusEnum.OgisticsStatus.已发货.GetHashCode();
            model.ConsignMentType = 0;//类型  发货

            #region 订单状态
            ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders();
            ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(this.lblOrderId.Text);
            #endregion
            try
            {
                bll.Add(model);

                #region 操作订单状态
                int OrderId = ChangeHope.WebPage.PageRequest.GetQueryInt("OrderId");
                orderBll.Amend(OrderId, "OgisticsStatus", ShowShop.Common.OrdersStatusEnum.OgisticsStatus.已发货.GetHashCode());
                #endregion

                ChangeHope.WebPage.BasePage.PageRight("已保存该信息.", "order_bank_pay.aspx?OrderId=" + orderModel.Id, "<li><a href='order_order_info.aspx?OrderId=" + orderModel.Id.ToString() + "'>返回信息页</a></li>");
                return;
            }
            catch
            {
                this.ltlMsg.Text = "操作失败!";
                this.pnlMsg.Visible = true;
                this.pnlMsg.CssClass = "actionErr";
            }
            finally
            {
                bll = null;
                model = null;
            }
        }
 private void Del(string id)
 {
     ShowShop.BLL.Order.ConsignMent bll = new ShowShop.BLL.Order.ConsignMent();
         bll.Delete(id);
         Response.Write("ok");
 }