Esempio n. 1
0
        /// <summary>
        /// 添加/编辑角色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            string sysName = txtName.Text.Trim();

            if (sysName == "")
            {
                AlertBack("请输入系统名称!");
                return;
            }
            SystemInfo system = new SystemInfo
            {
                ID          = SystemID,
                Description = this.txtDescription.Text,
                Name        = sysName,
                AddTime     = DateTime.Now,
                Status      = (StatusOptions)Convert.ToInt32(rblstatus.SelectedValue),
                Url         = txtUrl.Text.Trim()
            };

            try
            {
                //添加
                if (SystemID == 0)
                {
                    biService.AddSystem(system);
                    Response.Redirect(ReturnUrl);
                }
                else  //修改
                {
                    biService.UpdateSystem(system);
                    Response.Redirect(ReturnUrl);
                }
            }
            catch (NotRightException)
            {
                AlertBack("您没有权限执行此操作");
            }
            catch (net91com.Core.ToUserException ex)
            {
                AlertBack(ex.Message);
            }
        }