Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            // 检查输入的有效性
            if (!BasePageLogic.ControlValueIsEmpty(pnlMan))
            {
                return;
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            var holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                //增加了保存成功后关闭窗体
                if (this.SaveEntity(false))
                {
                    BasePageLogic.EmptyControlValue(pnlMan);
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                // 设置鼠标默认状态,原来的光标状态
                this.Cursor = holdCursor;
            }
        }
Exemplo n.º 2
0
 private void btnSaveContine_Click(object sender, EventArgs e)
 {
     if (BasePageLogic.ControlValueIsEmpty(pnlMain))
     {
         SaveData(false);
         BasePageLogic.EmptyControlValue(pnlMain);
     }
 }
Exemplo n.º 3
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (BasePageLogic.ControlValueIsEmpty(pnlMain) && this.SaveEntity())
     {
         this.Changed = true;
         BasePageLogic.EmptyControlValue(pnlMain);
         txtRealName.Focus();
     }
 }
Exemplo n.º 4
0
 private void btnSaveContinue_Click(object sender, EventArgs e)
 {
     if (BasePageLogic.ControlValueIsEmpty(pnlMain))
     {
         if (this.SaveEntity())
         {
             this.Changed = true;
         }
         BasePageLogic.EmptyControlValue(pnlMain);
         this.txtItemCode.Focus();
     }
 }
Exemplo n.º 5
0
 private void btnSaveContinue_Click(object sender, EventArgs e)
 {
     if (!BasePageLogic.ControlValueIsEmpty(gbMain))
     {
         return;
     }
     if (!this.SaveData())
     {
         return;
     }
     this.Changed = true;
     BasePageLogic.EmptyControlValue(gbMain);
     txtFullName.Focus();
 }
Exemplo n.º 6
0
 private void btnSaveContinue_Click(object sender, EventArgs e)
 {
     if (!BasePageLogic.ControlValueIsEmpty(gbDetail))
     {
         return;
     }
     if (this.SaveEntity())
     {
         isAddData    = true;
         this.Changed = true;
         BasePageLogic.EmptyControlValue(gbDetail);
         txtUserName.Focus();
     }
 }
Exemplo n.º 7
0
        private void btnSaveContine_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text.Trim()))
            {
                MessageBoxHelper.ShowWarningMsg(txtName.Tag.ToString() + "不能为空!");
                txtName.Focus();
                return;
            }

            SaveData(false);
            BasePageLogic.EmptyControlValue(pnlMain);
            txtNation.Text      = "中国";
            txtNationality.Text = "汉族";
            txtName.Focus();
        }
Exemplo n.º 8
0
        /// <summary>
        /// 保存序列
        /// </summary>
        /// <param name="close">关闭窗体</param>
        private void AddSequence(bool close = true)
        {
            // 检查输入的有效性
            if (!BasePageLogic.ControlValueIsEmpty(gbDetail))
            {
                return;
            }

            // 设置鼠标繁忙状态,并保留原先的状态
            Cursor holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            try
            {
                if (this.SaveEntity())
                {
                    if (close)
                    {
                        this.DialogResult = DialogResult.OK;
                        // 关闭窗口
                        this.Close();
                    }
                    else
                    {
                        BasePageLogic.EmptyControlValue(gbDetail);
                    }
                }
            }
            catch (Exception ex)
            {
                this.ProcessException(ex);
            }
            finally
            {
                // 设置鼠标默认状态,原来的光标状态
                this.Cursor = holdCursor;
            }
        }
Exemplo n.º 9
0
 private void btnSaveContine_Click(object sender, EventArgs e)
 {
     SaveData(false);
     BasePageLogic.EmptyControlValue(pnlMainData);
     txtFullName.Focus();
 }
Exemplo n.º 10
0
        /// <summary>
        /// 保存新增的数据
        /// </summary>
        /// <param name="close">增加成功是否关闭窗体</param>
        private void SaveAddData(bool close)
        {
            if (!BasePageLogic.ControlValueIsEmpty(gbMain))
            {
                return;
            }
            // 设置鼠标繁忙状态,并保留原先的状态
            var holdCursor = this.Cursor;

            this.Cursor = Cursors.WaitCursor;
            var moduleEntity = new PiModuleEntity
            {
                ParentId       = BusinessLogic.ConvertToString(txtParentId.SelectedValue),
                FullName       = txtFullName.Text.Trim(),
                Code           = txtCode.Text.Trim(),
                Target         = txtTarget.Text.Trim(),
                NavigateUrl    = txtNavigateUrl.Text.Trim(),
                MvcNavigateUrl = txtMvcNavigateUrl.Text.Trim(),
                ImageIndex     = SelectedFileId,
                IconUrl        = txtIconUrl.Text.Trim(),
                IconCss        = txtIconCss.Text.Trim(),
                FormName       = txtFormName.Text.Trim(),
                AssemblyName   = txtAssemblyName.Text.Trim(),
                ModuleType     = 3
            };

            if (rbModuleType1.Checked)
            {
                moduleEntity.ModuleType = 1;
            }

            if (rbModuleType2.Checked)
            {
                moduleEntity.ModuleType = 2;
            }

            if (rbModuleType3.Checked)
            {
                moduleEntity.ModuleType = 3;
            }

            if (string.IsNullOrEmpty(moduleEntity.NavigateUrl))
            {
                moduleEntity.NavigateUrl = @"#";
            }
            if (moduleEntity.ModuleType != null && moduleEntity.ModuleType == 2)
            {
                moduleEntity.IconCss = "icon-note";
            }

            moduleEntity.PermissionItemCode = "Resource.AccessPermission";
            moduleEntity.Enabled            = chkEnabled.Checked ? 1 : 0;
            moduleEntity.IsPublic           = chkIsPublic.Checked ? 1 : 0;
            moduleEntity.Expand             = chkExpand.Checked ? 1 : 0;
            moduleEntity.Description        = txtDescription.Text.Trim();
            moduleEntity.AllowDelete        = chkAllowDelete.Checked ? 1 : 0;
            moduleEntity.AllowEdit          = chkAllowEdit.Checked ? 1 : 0;
            moduleEntity.IsMenu             = chkIsMenu.Checked ? 1 : 0;
            moduleEntity.DeleteMark         = 0;

            string statusCode    = string.Empty;
            string statusMessage = string.Empty;

            this.EntityId = moduleService.Add(UserInfo, moduleEntity, out statusCode, out statusMessage);
            this.FullName = moduleEntity.FullName;
            this.ParentId = BusinessLogic.ConvertToString(moduleEntity.ParentId);
            if (statusCode == StatusCode.OKAdd.ToString())
            {
                this.Changed = true;

                if (SystemInfo.ShowInformation)
                {
                    // 添加成功,进行提示
                    MessageBoxHelper.ShowSuccessMsg(statusMessage);
                }
                if (close)
                {
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    BasePageLogic.EmptyControlValue(gbMain);
                    this.chkEnabled.Checked     = true;
                    this.chkAllowEdit.Checked   = true;
                    this.chkAllowDelete.Checked = true;
                    txtFullName.Focus();
                }
            }
            else
            {
                MessageBoxHelper.ShowWarningMsg(statusMessage);
                // 是否编号重复了,提高友善性
                if (statusCode == StatusCode.ErrorCodeExist.ToString())
                {
                    this.txtCode.SelectAll();
                    this.txtCode.Focus();
                }
            }
            // 设置鼠标默认状态,原来的光标状态
            this.Cursor = holdCursor;

            if (this.Changed && close)
            {
                this.Close();
            }
        }
Exemplo n.º 11
0
 public override void ClearScreen()
 {
     BasePageLogic.EmptyControlValue(gbDetail);
 }