Example #1
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            Warehouse        info   = new Warehouse();
            WarehouseBLL     bll    = null;
            DataResult <int> result = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);

                bll = BLLFactory.CreateBLL <WarehouseBLL>();

                if (this.hiID.Value == "")
                {
                    result = bll.Insert(info);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.ID         = this.hiID.Value;
                    result          = bll.Update(info);
                }

                if (string.IsNullOrEmpty(result.Msg) == false)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','" + result.Msg + "')", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }