Example #1
0
 /// <summary>
 ///  更新用户
 /// </summary>
 /// <param name="yh">用户对象</param>
 /// <param name="isNew">是否新增</param>
 public void UpdateYHList(Yh yh, bool isNew)
 {
     if (mCurrentDocument != null)
     {
         if (mCurrentDocument.Control.GetType() == typeof(Yhgl))
         {
             ((Yhgl)mCurrentDocument.Control).UpdateYHList(yh, isNew);
         }
     }
 }
Example #2
0
            public static Yh FromRow(DataRow dr)
            {
                Yh yh = new Yh();

                yh.Yhm  = dr["f_yhm"].ToString();
                yh.Yhmc = dr["f_yhmc"].ToString();
                yh.Yhmm = dr["f_yhmm"].ToString();
                yh.PYM  = GetSpellCode(yh.Yhmc);
                yh.Id   = dr["F_ID"].ToString();
                yh.Yhbh = dr["F_yhbh"].ToString();
                return(yh);
            }
Example #3
0
File: Yhgl.cs Project: chliam/dam
 /// <summary>
 /// 删除用户
 /// </summary>
 /// <param name="yh">用户</param>
 public void DeleteYH(Yh yh)
 {
     var userRoles = USERROLEDao.QueryForListByUserId(yh.Xh);
     if (userRoles != null)
     {
         foreach (var userRole in userRoles)
         {
             USERROLEDao.Delete(userRole.ID);
         }
     }
     USERDao.Delete(yh.Xh);
     mYhList.Remove(yh);
     mYhList.Sort(yhComparer);
     gcMain.RefreshDataSource();
 }
Example #4
0
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="yh">用户</param>
        public void DeleteYH(Yh yh)
        {
            var userRoles = USERROLEDao.QueryForListByUserId(yh.Xh);

            if (userRoles != null)
            {
                foreach (var userRole in userRoles)
                {
                    USERROLEDao.Delete(userRole.ID);
                }
            }
            USERDao.Delete(yh.Xh);
            mYhList.Remove(yh);
            mYhList.Sort(yhComparer);
            gcMain.RefreshDataSource();
        }
Example #5
0
        /// <summary>
        /// 显示删除用户确认界面
        /// </summary>
        /// <param name="yh">待删除的用户</param>
        public void ShowDeleteYHConfirm(Yh yh)
        {
            var deleteYHAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
            {
                Caption     = "删除确认",
                Description = string.Format("确定要删除【{0}】用户吗?", yh.Xm)
            };

            deleteYHAction.Commands.Add(FlyoutCommand.Yes);
            deleteYHAction.Commands.Add(FlyoutCommand.No);
            closeAppFlyout.Action = deleteYHAction;
            if (mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout) == DialogResult.Yes)
            {
                ((Yhgl)mCurrentDocument.Control).DeleteYH(yh);
            }
        }
Example #6
0
        /// <summary>
        /// 设置当前用户
        /// </summary>
        /// <param name="yh">如果对象为空则表示新增用户</param>
        public void SetCurrentYH(Yh yh)
        {
            if (yh == null)
            {
                lblTitle.Text = "新增用户";
                lblXh.Text    = USERDao.GetNewId().ToString();
                txtXm.Text    = "";
                txtDlm.Text   = "";

                rdbMale.Checked   = true;
                rdbFemale.Checked = false;

                cmbBm.SelectedIndex = 0;
                txtLxdh.Text        = "";
                txtEmail.Text       = "";
                cmbQx.SelectedIndex = 0;
            }
            else
            {
                lblTitle.Text = "编辑用户";
                lblXh.Text    = yh.Xh.ToString();
                txtXm.Text    = yh.Xm;
                txtDlm.Text   = yh.Dlm;
                if (yh.Xb == "男")
                {
                    rdbMale.Checked   = true;
                    rdbFemale.Checked = false;
                }
                else if (yh.Xb == "女")
                {
                    rdbMale.Checked   = false;
                    rdbFemale.Checked = true;
                }
                cmbBm.Text    = yh.Bm;
                txtLxdh.Text  = yh.Lxdh;
                txtEmail.Text = yh.Email;
                cmbQx.Text    = yh.Qx;
                txtPwd.Text   = yh.Password;
                txtPwd2.Text  = yh.Password;
            }
        }
Example #7
0
        /// <summary>
        /// 设置当前用户
        /// </summary>
        /// <param name="yh">如果对象为空则表示新增用户</param>
        public void SetCurrentYH(Yh yh)
        {
            if (yh == null)
            {
                lblTitle.Text = "新增用户";
                lblXh.Text = USERDao.GetNewId().ToString();
                txtXm.Text = "";
                txtDlm.Text = "";

                rdbMale.Checked = true;
                rdbFemale.Checked = false;

                cmbBm.SelectedIndex = 0;
                txtLxdh.Text = "";
                txtEmail.Text = "";
                cmbQx.SelectedIndex = 0;
            }
            else
            {
                lblTitle.Text = "编辑用户";
                lblXh.Text = yh.Xh.ToString();
                txtXm.Text = yh.Xm;
                txtDlm.Text = yh.Dlm;
                if (yh.Xb == "男")
                {
                    rdbMale.Checked = true;
                    rdbFemale.Checked = false;
                }
                else if (yh.Xb == "女")
                {
                    rdbMale.Checked = false;
                    rdbFemale.Checked = true;
                }
                cmbBm.Text = yh.Bm;
                txtLxdh.Text = yh.Lxdh;
                txtEmail.Text = yh.Email;
                cmbQx.Text = yh.Qx;
                txtPwd.Text = yh.Password;
                txtPwd2.Text = yh.Password;
            }
        }
Example #8
0
        private void BindingGrid()
        {
            mYhList.Clear();
            var users = USERDao.QueryForList();

            if (users != null)
            {
                foreach (var user in users)
                {
                    Yh yh = new Yh
                    {
                        Xh       = user.ID,
                        Xm       = user.REAL_NAME,
                        Dlm      = user.NAME,
                        Xb       = user.GENDER,
                        Bm       = user.DEPT,
                        Lxdh     = user.TEL,
                        Email    = user.EMAIL,
                        Password = user.PASSWORD
                    };
                    var userRoles = USERROLEDao.QueryForListByUserId(user.ID);
                    if (userRoles != null && userRoles.Count > 0)
                    {
                        ROLE role = ROLEDao.Get(userRoles[0].ROLE_ID);
                        if (role != null)
                        {
                            yh.Qx = role.DESCRIPTION;
                        }
                    }
                    mYhList.Add(yh);
                }
            }
            mYhList.Sort(yhComparer);
            gcMain.DataSource = mYhList;
            gcMain.RefreshDataSource();
        }
Example #9
0
File: Yhgl.cs Project: chliam/dam
 private void BindingGrid()
 {
     mYhList.Clear();
     var users = USERDao.QueryForList();
     if (users != null)
     {
         foreach (var user in users)
         {
             Yh yh = new Yh
             {
                 Xh = user.ID,
                 Xm = user.REAL_NAME,
                 Dlm = user.NAME,
                 Xb = user.GENDER,
                 Bm = user.DEPT,
                 Lxdh = user.TEL,
                 Email = user.EMAIL,
                 Password = user.PASSWORD
             };
             var userRoles = USERROLEDao.QueryForListByUserId(user.ID);
             if (userRoles != null && userRoles.Count > 0)
             {
                 ROLE role = ROLEDao.Get(userRoles[0].ROLE_ID);
                 if (role != null)
                 {
                     yh.Qx = role.DESCRIPTION;
                 }
             }
             mYhList.Add(yh);
         }
     }
     mYhList.Sort(yhComparer);
     gcMain.DataSource = mYhList;
     gcMain.RefreshDataSource();
 }
Example #10
0
File: Yhgl.cs Project: chliam/dam
 /// <summary>
 ///  更新用户
 /// </summary>
 /// <param name="yh">用户对象</param>
 /// <param name="isNew">是否新增</param>
 public void UpdateYHList(Yh yh, bool isNew)
 {
     BindingGrid();
 }
Example #11
0
 /// <summary>
 ///  更新用户
 /// </summary>
 /// <param name="yh">用户对象</param>
 /// <param name="isNew">是否新增</param>
 public void UpdateYHList(Yh yh, bool isNew)
 {
     BindingGrid();
 }
Example #12
0
 /// <summary>
 ///  更新用户
 /// </summary>
 /// <param name="yh">用户对象</param>
 /// <param name="isNew">是否新增</param>
 public void UpdateYHList(Yh yh, bool isNew)
 {
     if (mCurrentDocument != null)
     {
         if (mCurrentDocument.Control.GetType() == typeof(Yhgl))
         {
             ((Yhgl)mCurrentDocument.Control).UpdateYHList(yh, isNew);
         }
     }
 }
Example #13
0
 /// <summary>
 /// 显示用户编辑界面
 /// </summary>
 /// <param name="yh">用户为空时表示新增用户</param>
 public void ShowYHEditFlyout(Yh yh)
 {
     mPopupYHEditControl.SetCurrentYH(yh);
     mainWindowsUIView.ActivateContainer(popupYHEditFlyout);
 }
Example #14
0
 /// <summary>
 /// 显示删除用户确认界面
 /// </summary>
 /// <param name="yh">待删除的用户</param>
 public void ShowDeleteYHConfirm(Yh yh)
 {
     var deleteYHAction = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.FlyoutAction()
     {
         Caption = "删除确认",
         Description = string.Format("确定要删除【{0}】用户吗?", yh.Xm)
     };
     deleteYHAction.Commands.Add(FlyoutCommand.Yes);
     deleteYHAction.Commands.Add(FlyoutCommand.No);
     closeAppFlyout.Action = deleteYHAction;
     if (mainWindowsUIView.ShowFlyoutDialog(closeAppFlyout) == DialogResult.Yes)
     {
         ((Yhgl)mCurrentDocument.Control).DeleteYH(yh);
     }
 }
Example #15
0
 /// <summary>
 /// 显示用户编辑界面
 /// </summary>
 /// <param name="yh">用户为空时表示新增用户</param>
 public void ShowYHEditFlyout(Yh yh)
 {
     mPopupYHEditControl.SetCurrentYH(yh);
     mainWindowsUIView.ActivateContainer(popupYHEditFlyout);
 }