private void buttonItem2_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBoxCustom.Show("是否确认删除?", "提示", MessageBoxButtons.YesNo, this);

            if (res == DialogResult.Yes)
            {
                int      groupid = 0;//待定
                sys_user user    = new sys_user();
                user.username = "******";
                user.name     = "test";
                List <view_sys_u2g> userinfo = new List <view_sys_u2g>();
                userinfo = new SysUserBLL().Select(user);
                List <int> userid = new List <int>();
                foreach (var user1 in userinfo)
                {
                    userid.Add(user1.id);
                }
                Result result = new PermBLL().DelG2u(groupid, userid);
                if (result.Code == RES.OK)
                {
                    MessageBoxCustom.Show("删除成功", "提示", MessageBoxButtons.OK, this);
                    Close();
                }
                else if (result.Code == RES.ERROR)
                {
                    MessageBoxCustom.Show("删除失败", "提示", MessageBoxButtons.OK, this);
                }
            }
        }
Exemple #2
0
        private void BtnDelGroup_Click(object sender, EventArgs e)
        {
            List <int> list = new List <int>();

            list = SelectId();
            if (list.Count == 0)
            {
                MessageBox.Show("请勾选用户组");
            }
            else
            {
                DialogResult = MessageBoxCustom.Show("确认删除?", "操作确认", MessageBoxButtons.YesNo, this);
                if (DialogResult == DialogResult.Yes)
                {
                    PermBLL perm   = new PermBLL();
                    Result  result = new Result();
                    result = perm.DelAll(list);
                    if (result.Code == RES.OK)
                    {
                        MessageBoxCustom.Show("删除成功", "提示", this);
                    }
                    else
                    {
                        MessageBoxCustom.Show("删除失败", "提示", this);
                    }
                    DgvGroupMan.DataSource = null;
                    DgvGroupMan.DataSource = new PermBLL().SelectGroup(new sys_group());
                }
            }
        }
        private void BtnOutFile_Click(object sender, EventArgs e)
        {
            if (FileId == -1)
            {
                MessageBoxCustom.Show("请选择需要导出的文件!", "提示", this);
                return;
            }

            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.Description = "请选择保存文件路径";

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string foldPath = dialog.SelectedPath;
                Result result   = null;
                LoadingHelper.ShowLoading("文件导出中...", this, o =>
                {
                    PersonFileBLL personFileBLL = new PersonFileBLL();

                    result = personFileBLL.OutFile(FileId, foldPath);
                    FileId = -1;
                });

                FileStatus(result, "文件导出");
            }
        }
        private void BtnDelFile_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBoxCustom.Show("确认删除", "提示", MessageBoxButtons.YesNo, this);

            if (res == DialogResult.Yes)
            {
                int         id   = 0;
                person_file file = new person_file();
                /*file.id = 0*/;
                file.person_id = 0;
                List <person_file> pf = new List <person_file>();
                pf = new PersonFileBLL().GetByPersonId(PersonBasic.id);
                List <int> file1 = new List <int>();

                foreach (var file2 in pf)
                {
                    file1.Add(file2.id);
                }
                Result result = new PersonFileBLL().Del(id);
                if (result.Code == RES.OK)
                {
                    MessageBoxCustom.Show("删除成功", "提示", MessageBoxButtons.OK, this);
                    Close();
                }
                else if (result.Code == RES.ERROR)
                {
                    MessageBoxCustom.Show("删除失败", "提示", MessageBoxButtons.OK, this);
                }
            }
        }
 private void FileStatus(Result result, string title)
 {
     if (result?.Code == RES.OK)
     {
         MessageBoxCustom.Show(result.Message, title, this);
     }
     else if (result?.Code == RES.ERROR)
     {
         MessageBoxCustom.Show(result.Message, title, this);
     }
 }
Exemple #6
0
        private void btnAddUser_Click(object sender, EventArgs e)
        {
            sys_org org = new sys_org();

            org.org_name = comboBox1.SelectedItem.ToString();
            List <sys_org> orginfo = new List <sys_org>();
            //orginfo =//查询组织机构Id方法
            sys_user sys_User = new sys_user();

            sys_User.name     = textBoxX1.Text;
            sys_User.username = textBoxX2.Text;
            if (radioButton1.Checked)
            {
                sys_User.gender = "男";
            }
            else
            {
                sys_User.gender = "女";
            }
            sys_User.phone = textBoxX4.Text;
            sys_User.email = textBoxX5.Text;
            sys_User.job   = textBoxX6.Text;
            foreach (var id in orginfo)
            {
                sys_User.org_id = id.id;
            }
            if (radioButton3.Checked)
            {
                sys_User.status = false;
            }
            else
            {
                sys_User.status = true;
            }
            SysUserBLL sysUserBLL = new SysUserBLL();
            Result     result     = sysUserBLL.add(sys_User);

            if (result.Code == RES.OK)
            {
                MessageBoxCustom.Show("修改成功", "提示", MessageBoxButtons.OK, this);
                Close();
            }
            else if (result.Code == RES.ERROR)
            {
                MessageBoxCustom.Show("修改失败", "提示", MessageBoxButtons.OK, this);
            }
        }
Exemple #7
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            int        groupId = 0;//待定
            List <int> userid  = new List <int>();
            ///待定
            Result result = new PermBLL().AddU2g(groupId, userid);

            if (result.Code == RES.OK)
            {
                MessageBoxCustom.Show("添加成功", "提示", MessageBoxButtons.OK, this);
                Close();
            }
            else if (result.Code == RES.ERROR)
            {
                MessageBoxCustom.Show("添加失败", "提示", MessageBoxButtons.OK, this);
            }
        }
Exemple #8
0
 private void BtnDelUser_Click(object sender, EventArgs e)
 {
     if (selectid() == null)
     {
         MessageBox.Show("请勾选用户");
     }
     else
     {
         DialogResult = MessageBoxCustom.Show("确认删除?", "操作确认", MessageBoxButtons.YesNo, this);
         if (DialogResult == DialogResult.Yes)
         {
             new SysUserBLL().Del(selectid());
             DgvUserMan.DataSource = null;
             DgvUserMan.DataSource = new SysUserBLL().Select(new sys_user());
         }
     }
 }
Exemple #9
0
        private void BtnUpdateFile_Click(object sender, EventArgs e)
        {
            person_file A = new person_file();

            A.filename = LblFileName.Text;
            A.filename = TxtNewFileName.Text;
            PersonFileBLL set = new PersonFileBLL();
            Result        res = new Result();

            res = set.Update(A.filename, A.id);
            if (res.Message == "修改成功!")
            {
                MessageBoxCustom.Show("修改成功", "提示", this);
            }
            else
            {
                MessageBoxCustom.Show("修改失败", "提示", this);
            }
        }
        private void BtnAddUser_Click(object sender, EventArgs e)
        {
            sys_org org = new sys_org();

            org.org_name = CmbOrg.SelectedItem.ToString();
            List <sys_org> orginfo = new List <sys_org>();
            //orginfo =//查询组织机构Id方法
            sys_user sys_User = new sys_user();

            sys_User.name     = TxtName.Text;
            sys_User.username = TxtUsername.Text;
            if (RdoSex1.Checked)
            {
                sys_User.gender = "男";
            }
            else
            {
                sys_User.gender = "女";
            }
            sys_User.password = TxtPassword.Text;
            sys_User.phone    = TxtPhone.Text;
            sys_User.email    = TxtEmail.Text;
            sys_User.job      = TxtJob.Text;
            foreach (var id in orginfo)
            {
                sys_User.org_id = id.id;
            }
            SysUserBLL sysUserBLL = new SysUserBLL();
            Result     result     = sysUserBLL.add(sys_User);

            if (result.Code == RES.OK)
            {
                MessageBoxCustom.Show("添加成功", "提示", MessageBoxButtons.OK, this);
                Close();
            }
            else if (result.Code == RES.ERROR)
            {
                MessageBoxCustom.Show("添加失败", "提示", MessageBoxButtons.OK, this);
            }
        }
        private void buttonX1_Click_1(object sender, EventArgs e)
        {
            if (Text.Equals("添加类别名称"))
            {
                sys_dict dict = new sys_dict();


                dict.category_name = textBoxX1.Text;
                dict.dict_name     = SysDictTypeConvert.CToE(labelX3.Text);
                SysSettingBLL set    = new SysSettingBLL();
                Result        result = new Result();
                result = set.Add(dict);
                if (result.Message == "添加成功!")
                {
                    MessageBoxCustom.Show("添加成功", "提示", this);
                }
                else
                {
                    MessageBoxCustom.Show("添加失败", "提示", this);
                }
            }
            else
            {
                sys_dict dict = new sys_dict();
                dict.dict_name     = SysDictTypeConvert.CToE(labelX3.Text);
                dict.category_name = textBoxX1.Text;
                dict.id            = number;
                SysSettingBLL set    = new SysSettingBLL();
                Result        result = new Result();
                result = set.Update(dict);
                if (result.Message == "修改成功!")
                {
                    MessageBoxCustom.Show("修改成功", "提示", this);
                }
                else
                {
                    MessageBoxCustom.Show("修改失败", "提示", this);
                }
            }
        }
        private void buttonX1_Click(object sender, EventArgs e)
        {
            if (Text.Equals("添加用户组"))
            {
                sys_group group = new sys_group();
                group.group_name = textBoxX1.Text;
                group.remark     = textBoxX2.Text;
                PermBLL perm   = new PermBLL();
                Result  result = new Result();
                result = perm.Add(group);
                if (result.Message == "添加成功!")
                {
                    MessageBoxCustom.Show("添加成功", "提示", this);
                }
                else
                {
                    MessageBoxCustom.Show("添加失败", "提示", this);
                }
            }
            else
            {
                PermBLL   perm   = new PermBLL();
                sys_group group1 = new sys_group();
                group1.group_name = textBoxX1.Text;
                group1.remark     = textBoxX2.Text;
                group1.id         = number;

                Result result = new Result();
                result = perm.Update(group1);
                if (result.Message == "修改成功!")
                {
                    MessageBoxCustom.Show("修改成功", "提示", this);
                }
                else
                {
                    MessageBoxCustom.Show("修改失败", "提示", this);
                }
            }
        }
Exemple #13
0
        private void BtnQueryPerson_Click(object sender, EventArgs e)
        {
            List <string> vs = DGVOperations.SelectPersonBasic(dgvPerson);

            if (vs.Count > 1)
            {
                MessageBoxCustom.Show("只能选择一条记录!", "提示", this);
                return;
            }
            else if (vs.Count < 1)
            {
                MessageBoxCustom.Show("需要选择一条记录!", "提示", this);
                return;
            }

            person_basic personBasic = DGVOperations.GetSelectPersonBasic(vs[0]);

            if (personBasic != null)
            {
                PersonDetailForm personDetailForm = new PersonDetailForm(personBasic);
                personDetailForm.ShowDialog();
            }
        }
Exemple #14
0
        private void BtnDelType_Click(object sender, EventArgs e)
        {
            if (CmbDictType.SelectedItem == null)
            {
                MessageBox.Show("请先选择一个数据字典");
            }
            else
            {
                List <int> list3 = new List <int>();
                list3 = SelectSettingId();
                if (list3.Count == 0)
                {
                    MessageBox.Show("请勾选数据字典");
                }
                else
                {
                    DialogResult = MessageBoxCustom.Show("已经使用的数据字典系统自动保留,确认删除?", "操作确认", MessageBoxButtons.YesNo, this);
                    if (DialogResult == DialogResult.Yes)
                    {
                        SysSettingBLL set    = new SysSettingBLL();
                        Result        result = new Result();
                        result = set.DelAll(list3);
                        if (result.Code == RES.OK)
                        {
                            MessageBoxCustom.Show("删除成功", "提示", this);
                        }
                        else
                        {
                            MessageBoxCustom.Show("删除失败", "提示", this);
                        }

                        CmbDictType_SelectedValueChanged_1(sender, e);
                    }
                }
            }
        }
        /// <summary>
        /// 确认提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnConfirm_Click(object sender, EventArgs e)
        {
            person_basic pb = new person_basic();

            pb.user_id = pb.id = 1027;
            pb.user_id = UserInfoBLL.UserId;



            #region 姓名
            string name = TxtName.Text.Replace(" ", "");
            if (RegexComm.IsValidName(name))
            {
                LblName.Hide();
                pb.name = name;
            }
            else
            {
                LblName.Show();
                return;
            }
            #endregion

            #region 曾用名
            if (!string.IsNullOrEmpty(TxtFormerName.Text))
            {
                string formerName = TxtFormerName.Text.Replace(" ", "");
                if (RegexComm.IsValidName(formerName))
                {
                    LblFormerName.Hide();
                    pb.former_name = formerName;
                }
                else
                {
                    LblFormerName.Show();
                    return;
                }
            }
            #endregion

            #region 性别
            if (RdoMale.Checked)
            {
                pb.gender = RdoMale.Text;
            }
            if (RdoFemale.Checked)
            {
                pb.gender = RdoFemale.Text;
            }
            #endregion

            #region 身份证号
            if (RegexComm.IsValidIdNum(TxtIdentityNumber.Text))
            {
                LblIdentityNumber.Hide();
                pb.identity_number = TxtIdentityNumber.Text;
            }
            else
            {
                LblIdentityNumber.Show();
                return;
            }
            #endregion

            #region 出生日期
            if (DateTime.Compare(TimeBirthDate.Value, DateTime.Now) > 0)
            {
                LblBirthDate.Show();
                return;
            }
            else
            {
                LblBirthDate.Hide();
                pb.birth_date = TimeBirthDate.Value;
            }

            #endregion

            #region 籍贯
            if (CmbProvince.Text.Equals(province) || CmbCity.Text.Equals(city) || CmbPlace.Text.Equals(place))
            {
                LblNativePlace.Show();
            }
            else
            {
                LblNativePlace.Hide();
                pb.native_place = CmbProvince.Text + CmbCity.Text + CmbPlace.Text;
            }
            #endregion

            #region 婚姻状况
            if (CmbMarry.Text.Equals("已婚"))
            {
                pb.marry_status = true;
            }
            if (CmbMarry.Text.Equals("未婚"))
            {
                pb.marry_status = false;
            }
            #endregion

            #region 工作状况
            pb.job_status = TxtJob.Text;
            #endregion

            #region 收入状况
            if (!string.IsNullOrEmpty(TxtIncome.Text))
            {
                if (Convert.ToDecimal(TxtIncome.Text) < 0)
                {
                    LblIncome.Show();
                    return;
                }
                else
                {
                    LblIncome.Hide();
                    pb.income = Convert.ToDecimal(TxtIncome.Text);
                }
            }
            #endregion

            #region 性格特征
            pb.temper = TxtTemper.Text;
            #endregion

            #region 家庭成员
            pb.family = TxtFamily.Text;
            #endregion

            #region 人员类型
            PersonType = new SysSettingBLL().SelectByDictName(sys_dict_type.Person);
            foreach (var item in PersonType)
            {
                if (item.category_name.Equals(CmbPersonType.Text))
                {
                    pb.person_type_id = item.id;
                }
            }
            #endregion

            #region QQ
            pb.qq = TxtQQ.Text;
            #endregion

            #region 住址
            if (string.IsNullOrEmpty(TxtAddress.Text))
            {
                LblAddress.Show();
            }
            else
            {
                LblAddress.Hide();
                pb.address = TxtAddress.Text;
            }
            #endregion

            #region 电话
            if (!string.IsNullOrWhiteSpace(TxtPhone.Text))
            {
                string phone = TxtPhone.Text.Replace(" ", "");
                if (RegexComm.IsValidPhone(phone))
                {
                    LblPhone.Hide();
                    pb.phone = phone;
                }
                else
                {
                    LblPhone.Show();
                    return;
                }
            }
            else
            {
                LblPhone.Show();
                return;
            }
            #endregion

            #region 归属地
            BelongPlace = new SysSettingBLL().SelectByDictName(sys_dict_type.BelongPlace);
            foreach (var item in BelongPlace)
            {
                if (item.category_name.Equals(CmbBelongPlace.Text))
                {
                    pb.belong_place_id = item.id;
                }
            }
            #endregion

            #region 民族
            pb.nation = CmbNation.Text;
            #endregion

            #region 添加日期
            pb.input_time = DateTime.Now;
            #endregion

            #region 用户id
            pb.user_id = UserInfoBLL.UserId;
            #endregion

            #region  除标记
            pb.isdel = 0;
            #endregion

            #region 判断结果
            Result r;
            if (Text.Equals("人员信息录入"))
            {
                r = new PersonBasicBLL().Add(pb);
            }
            else
            {
                r = new PersonBasicBLL().Update(pb);
            }

            //if (r.Code == RES.OK)
            //{
            //    MessageBoxCustom.Show(r.Message, "", this);
            //}
            //else
            //{
            //    MessageBoxCustom.Show(r.Message, "", this);
            //}
            MessageBoxCustom.Show(r.Message, "提示", this);
            #endregion
        }