private void Page_Load(object sender, System.EventArgs e)
 {
     // 在此处放置用户代码以初始化页面
     this.Response.Expires         = -1;
     this.Response.ExpiresAbsolute = DateTime.Now.AddMilliseconds(-1);
     this.Response.CacheControl    = "no-cache";
     this.Button2.Attributes.Add("onclick", "window.returnValue='cccc';window.close()");
     if (!this.IsPostBack)
     {
         Bind();
         string strflag = this.Request.QueryString["flag"].ToString();
         //string strinvccode = this.Request.QueryString["invccode"].ToString();
         if (strflag == "add")
         {
             this.lblTitle.Text  = "添加仓库档案";
             this.txtWhCode.Text = this.ddlDepCode.SelectedValue + this.GetWhCode(this.ddlDepCode.SelectedValue);
         }
         if (strflag == "modify")
         {
             this.lblTitle.Text = "修改仓库档案";
             string           strwhcode = this.Request.QueryString["whcode"].ToString();
             string           strsql    = "select * from tbwarehouse where cnvcwhcode='" + strwhcode + "'";
             DataTable        dtWh      = Helper.Query(strsql);
             Entity.Warehouse wh        = new AMSApp.zhenghua.Entity.Warehouse(dtWh);
             BindWh(wh);
             //this.txtWhCode.Enabled = false;
             this.ddlDepCode.Enabled = false;
         }
         this.txtWhCode.Enabled = false;
     }
 }
 private Entity.Warehouse GetWh()
 {
     if (this.txtFrequency.Text == "")
     {
         this.txtFrequency.Text = "1";
     }
     Entity.Warehouse wh = new AMSApp.zhenghua.Entity.Warehouse();
     wh.cnvcWhCode       = this.txtWhCode.Text;
     wh.cnvcWhName       = this.txtWhName.Text;
     wh.cnvcDepCode      = this.ddlDepCode.SelectedValue;
     wh.cnvcWhAddress    = this.txtWhAddress.Text;
     wh.cnvcWhPhone      = this.txtWhPhone.Text;
     wh.cnvcWhPerson     = this.ddlWhPerson.SelectedValue;
     wh.cnvcWhValueStyle = this.ddlWhValueStyle.SelectedValue;
     wh.cnbFreeze        = this.chkFreeze.Checked;
     wh.cnnFrequency     = Convert.ToInt16(this.txtFrequency.Text);
     wh.cnvcFrequency    = this.ddlFrequency.SelectedValue;
     wh.cnvcWhProperty   = this.ddlWHProperty.SelectedValue;
     wh.cnbShop          = this.chkShop.Checked;
     return(wh);
 }