Esempio n. 1
0
        /// <summary>
        /// 停用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Stop_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow dr = gv_Role.GetDataRow(gv_Role.FocusedRowHandle);

                if (dr != null)
                {
                    ModTS_ROLE_PCI mod = bllRole.GetModel(dr["C_ID"].ToString());

                    if (mod != null)
                    {
                        mod.N_STATUS = 0;
                        mod.C_EMP_ID = UserInfo.userID;
                        mod.D_MOD_DT = ServerTime.timeNow();

                        if (bllRole.Update(mod))
                        {
                            MessageBox.Show("停用成功!");

                            BindRole();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Del_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow dr = gv_ANXX.GetDataRow(gv_ANXX.FocusedRowHandle);
                if (dr != null)
                {
                    ModTS_DEPT model = bllDept.GetModel(dr["C_ID"].ToString());
                    if (model != null)
                    {
                        model.N_STATUS   = 0;
                        model.C_EMP_ID   = UserInfo.userID;
                        model.C_EMP_NAME = UserInfo.userName;
                        model.D_MOD_DT   = ServerTime.timeNow();
                        if (bllDept.Update(model))
                        {
                            MessageBox.Show("删除成功!");

                            DataTable dt_ITEM = bllDept.Get_List(tag).Tables[0];
                            gc_ANXX.DataSource = dt_ITEM;
                            gv_ANXX.BestFitColumns();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txt_Pwd1.Text.Trim()))
                {
                    MessageBox.Show("密码不能为空!");
                    return;
                }

                if (string.IsNullOrEmpty(txt_Pwd2.Text.Trim()))
                {
                    MessageBox.Show("密码不能为空!");
                    return;
                }

                if (txt_Pwd1.Text.Trim() == txt_Pwd2.Text.Trim())
                {
                    ModTS_USER mod = bll.GetModel(UserInfo.userID);
                    if (mod != null)
                    {
                        mod.C_PASSWORD = Common.MD5(txt_Pwd1.Text.Trim()); //密码
                        mod.D_MOD_DT   = ServerTime.timeNow();             //系统操作时间

                        if (bll.Update(mod))
                        {
                            MessageBox.Show("密码修改成功!");
                            this.Close();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("两次密码输入不一致!");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 4
0
        private void btn_Edit_Click(object sender, EventArgs e)
        {
            try
            {
                DataRow dr = gv_ANXX.GetDataRow(gv_ANXX.FocusedRowHandle);
                if (dr != null)
                {
                    ModTS_DEPT model = bllDept.GetModel(dr["C_ID"].ToString());
                    if (model != null)
                    {
                        if (string.IsNullOrEmpty(gv_ANXX.GetRowCellValue(gv_ANXX.FocusedRowHandle, "C_NAME").ToString()))
                        {
                            MessageBox.Show("部门名称不能为空!");
                            return;
                        }

                        model.C_NAME     = gv_ANXX.GetRowCellValue(gv_ANXX.FocusedRowHandle, "C_NAME").ToString();
                        model.C_EMP_ID   = UserInfo.userID;
                        model.C_EMP_NAME = UserInfo.userName;
                        model.D_MOD_DT   = ServerTime.timeNow();

                        if (bllDept.Update(model))
                        {
                            MessageBox.Show("修改成功!");

                            DataTable dt_ITEM = bllDept.Get_List(tag).Tables[0];
                            gc_ANXX.DataSource = dt_ITEM;
                            gv_ANXX.BestFitColumns();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 5
0
        private void btn_Reset_Click(object sender, EventArgs e)
        {
            try
            {
                ModTS_USER mod = bll.GetModel(strUserID);
                if (mod != null)
                {
                    mod.C_PASSWORD = Common.MD5("123456"); //密码
                    mod.C_EMP_ID   = UserInfo.userID;      //系统操作人编号
                    mod.C_EMP_NAME = UserInfo.userName;    //系统操作人姓名
                    mod.D_MOD_DT   = ServerTime.timeNow(); //系系统操作时间

                    if (bll.Update(mod))
                    {
                        MessageBox.Show("密码重置成功!");
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txt_UserName.Text.Trim()))
                {
                    MessageBox.Show("姓名不能为空!");
                    return;
                }

                if (string.IsNullOrEmpty(txt_LoginName.Text.Trim()))
                {
                    MessageBox.Show("账号不能为空!");
                    return;
                }

                //if (string.IsNullOrEmpty(txt_Email.Text.Trim()))
                //{
                //    MessageBox.Show("邮箱不能为空!");
                //    return;
                //}

                //if (string.IsNullOrEmpty(txt_Tel.Text.Trim()))
                //{
                //    MessageBox.Show("电话不能为空!");
                //    return;
                //}

                ModTS_USER mod = bll.GetModel(strUserID);
                if (mod != null)
                {
                    mod.C_NAME     = txt_UserName.Text.Trim();              //姓名
                    mod.C_EMAIL    = txt_Email.Text.Trim();                 //邮箱
                    mod.C_MOBILE   = txt_Tel.Text.Trim();                   //电话
                    mod.N_STATUS   = Convert.ToInt32(icbo_State.EditValue); //状态(1正常,2,3,4冻结)
                    mod.C_EMP_ID   = UserInfo.userID;                       //系统操作人编号
                    mod.C_EMP_NAME = UserInfo.userName;                     //系统操作人姓名
                    mod.D_MOD_DT   = ServerTime.timeNow();                  //系系统操作时间

                    if (bll.Update(mod))
                    {
                        if (!string.IsNullOrEmpty(btnEdit_Dept.Text.Trim()))
                        {
                            BllTS_USER_DEPT bllUserDept = new BllTS_USER_DEPT();

                            ModTS_USER_DEPT model = bllUserDept.Get_Model(strUserID);
                            if (model != null)
                            {
                                model.C_DEPT_ID = strDeptID;
                                bllUserDept.Update(model);
                            }
                            else
                            {
                                model           = new ModTS_USER_DEPT();
                                model.C_DEPT_ID = strDeptID;
                                model.C_USER_ID = strUserID;

                                bllUserDept.Add(model);
                            }
                        }

                        MessageBox.Show("修改成功!");
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                BllTS_USER bll = new BllTS_USER();

                if (string.IsNullOrEmpty(txt_UserName.Text.Trim()))
                {
                    MessageBox.Show("姓名不能为空!");
                    return;
                }

                if (string.IsNullOrEmpty(txt_LoginName.Text.Trim()))
                {
                    MessageBox.Show("账号不能为空!");
                    return;
                }
                else
                {
                    if (bll.Exists(txt_LoginName.Text.Trim()))
                    {
                        MessageBox.Show("该账号已存在,不能重复添加!");
                        return;
                    }
                }

                //if (string.IsNullOrEmpty(txt_Email.Text.Trim()))
                //{
                //    MessageBox.Show("邮箱不能为空!");
                //    return;
                //}

                //if (string.IsNullOrEmpty(txt_Tel.Text.Trim()))
                //{
                //    MessageBox.Show("电话不能为空!");
                //    return;
                //}

                ModTS_USER mod = new ModTS_USER();
                mod.C_NAME     = txt_UserName.Text.Trim();  //姓名
                mod.C_ACCOUNT  = txt_LoginName.Text.Trim(); //登录名
                mod.C_PASSWORD = Common.MD5("123456");      //密码
                mod.C_EMAIL    = txt_Email.Text.Trim();     //邮箱
                mod.C_MOBILE   = txt_Tel.Text.Trim();       //电话
                mod.N_TYPE     = 3;                         //用户类型(1内部,2新用户,3PCI用户)
                mod.N_STATUS   = 1;                         //状态(1正常,2,3,4冻结)
                mod.C_EMP_ID   = UserInfo.userID;           //系统操作人编号
                mod.C_EMP_NAME = UserInfo.userName;         //系统操作人姓名
                mod.D_MOD_DT   = ServerTime.timeNow();      //系系统操作时间

                if (bll.Add(mod))
                {
                    txt_UserName.Text  = "";
                    txt_LoginName.Text = "";
                    txt_Email.Text     = "";
                    txt_Tel.Text       = "";

                    if (!string.IsNullOrEmpty(btnEdit_Dept.Text.Trim()))
                    {
                        BllTS_USER_DEPT bllUserDept = new BllTS_USER_DEPT();

                        ModTS_USER_DEPT model = new ModTS_USER_DEPT();
                        model.C_DEPT_ID = strDeptID;
                        model.C_USER_ID = mod.C_ACCOUNT;
                        bllUserDept.Add(model);
                    }

                    MessageBox.Show("添加成功!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsEdit)//修改
                {
                    modModule.C_MODULENAME   = txt_ModuleName.Text.Trim();
                    modModule.C_ASSEMBLYNAME = cbo_BllName.Text;
                    modModule.C_MODULECLASS  = cbo_FrmName.Text;
                    modModule.C_DISABLE      = icbo_State.EditValue.ToString();
                    modModule.N_IMAGEINDEX   = Convert.ToInt32(icbo_ImgIndex.EditValue.ToString());
                    modModule.C_EMP_ID       = UserInfo.userID;
                    modModule.D_MOD_DT       = ServerTime.timeNow();
                    modModule.C_QUERY_STR    = txt_Parameter.Text.Trim();

                    if (bllModule.Update(modModule))
                    {
                        bllModule.Update(modModule.C_MODULEID, modModule.C_DISABLE);

                        this.Close();
                    }
                }
                else//新增
                {
                    ModTS_MODULE modNew = new ModTS_MODULE();

                    if (modModule != null)
                    {
                        modNew.C_PARENTMODULEID = modModule.C_MODULEID;
                    }
                    else
                    {
                        modNew.C_PARENTMODULEID = "0";
                    }


                    int MaxID = bllModule.GetMaxID();
                    if (MaxID == 0)
                    {
                        MessageBox.Show("无法添加信息!");
                        return;
                    }
                    else
                    {
                        modNew.C_MODULEID = (MaxID + 1).ToString();
                    }

                    modNew.C_MODULENAME   = txt_ModuleName.Text.Trim();
                    modNew.C_ASSEMBLYNAME = cbo_BllName.SelectedText;
                    modNew.C_MODULECLASS  = cbo_FrmName.SelectedText;
                    modNew.C_DISABLE      = icbo_State.EditValue.ToString();
                    modNew.N_IMAGEINDEX   = Convert.ToInt32(icbo_ImgIndex.EditValue.ToString());
                    modNew.N_ORDER        = bllModule.GetOrder(strModuleID) + 1;
                    modNew.C_EMP_ID       = UserInfo.userID;
                    modNew.D_MOD_DT       = ServerTime.timeNow();
                    modNew.C_QUERY_STR    = txt_Parameter.Text.Trim();

                    if (bllModule.Add(modNew))
                    {
                        MessageBox.Show("添加成功!");
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                BllTB_LOG bllLog = new BllTB_LOG();
                ModTB_LOG mod    = new ModTB_LOG();
                mod.C_MENU_NAME    = "菜单管理";
                mod.C_OPER_CONTEXT = ex.Message.ToString();

                bllLog.Add(mod);
            }
        }