Пример #1
0
        /// <summary>
        /// 加载页面信息
        /// </summary>
        private void BindShow()
        {
            string id = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(id))
            {
                Business_CompanyInfoBLL bllCompany  = new Business_CompanyInfoBLL();
                Business_CompanyInfo    CompanyInfo = bllCompany.Find(p => p.CompanyInfoID == id);
                if (CompanyInfo == null)
                {
                    MessageBox.ShowAndRedirect(this, "该数据不存在!", "CompanyList.aspx");
                }
                else
                {
                    FormModel.SetForm <Business_CompanyInfo>(this, CompanyInfo, "txt");
                    FormModel.SetForm <Business_CompanyInfo>(this, CompanyInfo, "ddl");
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 保存按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_Click(object sender, ImageClickEventArgs e)
        {
            string id  = Request.QueryString["id"];
            string msg = string.Empty;

            if (!string.IsNullOrEmpty(id))
            {
                Business_CompanyInfoBLL bllCompany  = new Business_CompanyInfoBLL();
                Business_CompanyInfo    CompanyInfo = bllCompany.Find(p => p.CompanyInfoID == id);
                FormModel.GetForm <Business_CompanyInfo>(this, CompanyInfo, "txt");
                FormModel.GetForm <Business_CompanyInfo>(this, CompanyInfo, "ddl");
                CompanyInfo.CompanyInfo_UpdateTime   = DateTime.Now;
                CompanyInfo.CompanyInfo_UpdateUserId = base.CurrUserInfo().UserID;
                bool bol = bllCompany.Update(CompanyInfo, out msg);
                if (bol)
                {
                    MessageBox.ShowAndRedirect(this, "保存成功!", "CompanyList.aspx");
                }
            }
            else
            {
                MessageBox.Show(this, msg);
            }
        }