コード例 #1
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            ViewState["ID"] = Request.QueryString["ID"] != null ? int.Parse(Request.QueryString["ID"]) : 0;
            #endregion

            BindDropDown();

            if ((int)ViewState["ID"] != 0)
            {
                //修改
                BindData();
            }
            else
            {
                //新增
                ViewState["Client"] = Request.QueryString["Client"] != null ? int.Parse(Request.QueryString["Client"]) : 0;
                ViewState["WareHouse"] = Request.QueryString["WareHouse"] != null ? int.Parse(Request.QueryString["WareHouse"]) : 0;
                ViewState["Salesman"] = Request.QueryString["Salesman"] != null ? int.Parse(Request.QueryString["Salesman"]) : 0;

                PBM_Delivery d = new PBM_Delivery();
                d.Supplier = (int)Session["OwnerClient"];
                d.SupplierWareHouse = (int)ViewState["WareHouse"];
                d.Client = (int)ViewState["Client"];
                d.SalesMan = (int)ViewState["Salesman"];
                d.Classify = 1;
                d.PrepareMode = 1;

                pl_detail.BindData(d);

                ViewState["Details"] = new ListTable<PBM_DeliveryDetail>(new List<PBM_DeliveryDetail>(), "ID");
            }

        }
    }
コード例 #2
0
 public Delivery(PBM_Delivery m)
 {
     if (m != null) FillModel(m.ID);
 }