Example #1
0
        private void GetProgramByID(string procID)
        {
            M_Program program = null;

            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    program = adminBll.GetProgramByID(procID);
                }

                if (program != null)
                {
                    this.txtPROG_ID.EditValue     = program.PROG_ID;
                    this.txtPROG_NAME.EditValue   = program.PROG_NAME;
                    this.txtPROG_KEY.EditValue    = program.PROG_KEY;
                    this.luePROG_TYPE.EditValue   = program.PROG_TYPE;
                    this.txtORDER_BY.EditValue    = program.ORDER_BY;
                    this.txtICON.EditValue        = program.ICON;
                    this.txtDESCRIPTION.EditValue = program.DESCRIPTION;
                    this.icbREC_STAT.EditValue    = program.REC_STAT;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #2
0
        private void GetRoleList()
        {
            try
            {
                base.BeginProcessing("Begin Load data...", "Please Waiting for Loading Data");

                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    this.lstRole = adminBll.GetRoleList();
                }

                if (this.lstRole != null)
                {
                    this.grdRole.DataSource = this.lstRole;
                }
                else
                {
                    this.grdRole.DataSource = null;
                }
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }
Example #3
0
        private void GetProgramList(string procType, string procID)
        {
            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    this.ProgramList = adminBll.GetProgramList(procType, procID);
                }

                if (this.ProgramList != null)
                {
                    this.grdProgramList.DataSource = this.ProgramList;
                    this.dntProgram.DataSource     = this.ProgramList;
                }
                else
                {
                    this.grdProgramList.DataSource = null;
                    this.dntProgram.DataSource     = null;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #4
0
        private void GetUserInfo()
        {
            User user = null;

            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    user = adminBll.GetUserByUserID(this._USER_ID);
                }

                if (user != null)
                {
                    this.txtUSER_ID.EditValue     = user.USER_ID;
                    this.txtUSER_NAME.EditValue   = user.USER_NAME;
                    this.txtEMPLOYEE_ID.EditValue = user.EMPLOYEE_ID;
                    this.txtLOGIN.EditValue       = user.LOGIN;

                    this.txtPWD.EditValue        = null;
                    this.txtConfirmPws.EditValue = null;

                    this.IsAdminRole = user.ROLE_ID.Equals("ADM");
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }
Example #5
0
        private void GetUserByUserID(string userid)
        {
            User user = null;

            using (AdministratorBLL adminBll = new AdministratorBLL())
            {
                user = adminBll.GetUserByUserID(userid);
            }

            if (user != null)
            {
                this.txtUSER_ID.EditValue     = user.USER_ID;
                this.txtUSER_NAME.EditValue   = user.USER_NAME;
                this.txtWARE_ID.EditValue     = user.WARE_ID;
                this.txtLOGIN.EditValue       = user.LOGIN;
                this.txtPWD.EditValue         = user.PWD;
                this.txtEMPLOYEE_ID.EditValue = user.EMPLOYEE_ID;
                this.lueDefaultRole.EditValue = user.ROLE_ID;

                this.txtREMARK.EditValue   = user.REMARK;
                this.txtEMAIL.EditValue    = user.EMAIL;
                this.txtCOMP_ID.EditValue  = user.COMP_ID;
                this.icbREC_STAT.EditValue = user.REC_STAT;

                this.GetUserRoleList(user.USER_ID);

                GridView view = (GridView)this.grdRole.Views[0];
                UiUtility.RemoveActiveRow(view);
            }
        }
Example #6
0
        private void InsertRole()
        {
            string result = string.Empty;
            Role   role   = null;

            try
            {
                DataRow rowRole = this.dtbRole.Rows[0];
                if (rowRole != null)
                {
                    role = new Role();

                    role.ROLE_ID   = rowRole["ROLE_ID"].ToString().ToUpper();
                    role.ROLE_NAME = rowRole["ROLE_NAME"].ToString();
                    role.REC_STAT  = (bool)rowRole["REC_STAT"];
                }

                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.InsertRole(role, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (result.Equals("OK"))
                {
                    NotifierResult.Show("Insert Complete", "Result", 50, 1000, 50, NotifyType.Safe);
                }
                else
                {
                    NotifierResult.Show(result, "Error", 100, 1000, 0, NotifyType.Warning);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                this.FormState = eFormState.ReadOnly;
                //Get all Invoice on Invoice List
                this.GetRoleList();

                if (result.Equals("OK"))
                {
                    GridView viewList = (GridView)this.grdRole.Views[0];
                    viewList.ClearSorting();
                    int position = UiUtility.GetRowHandleByColumnValue(viewList, "ROLE_ID", role.ROLE_ID);
                    if (position != 0)
                    {
                        if (position != GridControl.InvalidRowHandle)
                        {
                            this.dntRole.Position = position;
                        }
                    }
                    else
                    {
                        viewList.FocusedRowHandle = 0;
                    }
                }
            }
        }
Example #7
0
        private void UserChangePassword(string newPassword)
        {
            string result = string.Empty;

            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.UserChangePassword(newPassword, this._USER_ID);
                }

                if (!result.Equals("OK"))
                {
                    XtraMessageBox.Show(result, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.txtPWD.Text        = string.Empty;
                    this.txtConfirmPws.Text = string.Empty;
                    this.txtPWD.Focus();
                }
                else
                {
                    XtraMessageBox.Show("Change Password Completed");
                    this.txtPWD.Text        = string.Empty;
                    this.txtConfirmPws.Text = string.Empty;
                    this.btnExit.Focus();
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }
Example #8
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (!this.ValidationForms())
            {
                return;
            }
            bool isVid = false;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                using (AdministratorBLL adminBLL = new AdministratorBLL())
                {
                    isVid = adminBLL.UserAuthentication(this.txtUserName.Text, this.txtPassword.Text);

                    if (isVid)
                    {
                        if (this.chkRememberMe.Checked)
                        {
                            HTN.BITS.UIL.PLASESS.Properties.Settings.Default.RememberUser = this.txtUserName.Text;
                            HTN.BITS.UIL.PLASESS.Properties.Settings.Default.Save();
                        }
                        else
                        {
                            HTN.BITS.UIL.PLASESS.Properties.Settings.Default.RememberUser = string.Empty;
                            HTN.BITS.UIL.PLASESS.Properties.Settings.Default.Save();
                        }

                        if (this.LogInIdle.IsRunning)
                        {
                            this.LogInIdle.Stop();
                        }
                        //is authentication pass
                        this.UserID       = adminBLL.UserID;
                        Cursor.Current    = Cursors.Default;
                        this.DialogResult = DialogResult.Yes;
                    }
                    else
                    {
                        Cursor.Current = Cursors.Default;
                        //is authentication fail
                        //this.DialogResult = DialogResult.No;
                        XtraMessageBox.Show("Invalid User name or Password", "Authentication", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                    }
                }
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #9
0
        private void GetUserRoleList(string userid)
        {
            using (AdministratorBLL adminBll = new AdministratorBLL())
            {
                this.dtbUserRole = adminBll.GetUserRoleByUserID(userid);
            }

            if (this.dtbUserRole != null)
            {
                this.grdRole.DataSource = this.dtbUserRole;
            }
        }
Example #10
0
        private void UpdateUserRole()
        {
            if (this.dtbUserRole.Rows.Count == 0)
            {
                return;
            }
            string      result  = string.Empty;
            List <Role> lstRole = null;

            try
            {
                lstRole = new List <Role>(this.dtbUserRole.Rows.Count);

                //Check Delete Recore
                if (this.delUserRole != null)
                {
                    foreach (Role roleDel in this.delUserRole)
                    {
                        lstRole.Add(roleDel);
                    }
                }

                Role role;
                foreach (DataRow dr in this.dtbUserRole.Rows)
                {
                    role = new Role();

                    role.ROLE_ID = dr["ROLE_ID"].ToString();
                    //REC_STAT for Status of Role Program
                    role.REC_STAT = (bool)dr["REC_STAT"];
                    role.FLAG     = Convert.ToInt32(dr["FLAG"].ToString());

                    lstRole.Add(role);
                }

                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.UpdateUserRole(this.txtUSER_ID.Text, lstRole, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (!result.Equals("OK"))
                {
                    XtraMessageBox.Show(this, result, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
            }
        }
Example #11
0
        private void GetUserList()
        {
            using (AdministratorBLL adminBll = new AdministratorBLL())
            {
                this.UserList = adminBll.GetUserList(string.Empty);
            }

            if (this.UserList != null)
            {
                this.grdUserList.DataSource = this.UserList;
                this.dntUser.DataSource     = this.UserList;
            }
        }
Example #12
0
        private void InitializaLOVData()
        {
            List <ProgramType> lstProgramType;

            using (AdministratorBLL adminBll = new AdministratorBLL())
            {
                lstProgramType = adminBll.GetProgramTypeList(string.Empty);
            }

            this.grvProgramList_rps_PROG_TYPE.DataSource = lstProgramType;
            this.luePROG_TYPE.Properties.DataSource      = lstProgramType;
            this.lueProgramType.Properties.DataSource    = lstProgramType;
        }
        private void GetEditProgramType(string procTypeID)
        {
            using (AdministratorBLL adminBll = new AdministratorBLL())
            {
                this.dtbProgramType = adminBll.GetProgramType(procTypeID);
            }

            if (this.dtbProgramType != null)
            {
                this.grdProgramType.DataSource = this.dtbProgramType;
                this.dntProgramType.DataSource = this.dtbProgramType;
            }
        }
        private void GetProgramTypeList()
        {
            using (AdministratorBLL adminBll = new AdministratorBLL())
            {
                this.dtbProgramType = adminBll.GetProgramType(string.Empty);
            }

            if (this.dtbProgramType != null)
            {
                this.grdProgramType.DataSource = this.dtbProgramType;
                this.dntProgramType.DataSource = this.dtbProgramType;
            }
        }
Example #15
0
        private void InitializaLOVData()
        {
            List <Role> lstRole;

            using (AdministratorBLL adminBll = new AdministratorBLL())
            {
                lstRole = adminBll.GetRoleList();
            }

            //for storage type
            this.grvUserList_rps_ROLE_ID.DataSource   = lstRole;
            this.lueDefaultRole.Properties.DataSource = lstRole;
        }
Example #16
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            string result = string.Empty;

            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    adminBll.TEST_PROC_EXCEPTION("TEST");
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }
Example #17
0
        private bool SucessAuthentication(string uname, string password)
        {
            bool isSucess = false;

            try
            {
                using (AdministratorBLL userBLL = new AdministratorBLL())
                {
                    isSucess = userBLL.ManagerAuthenRollback(uname, password, string.Empty);
                }
            }
            catch
            {
                isSucess = false;
            }

            return(isSucess);
        }
Example #18
0
        public string GetLatestVersion(string curVersion)
        {
            Version resultVersion;

            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    resultVersion = adminBll.GetLastestVersion(curVersion);
                }
            }
            catch (Exception ex)
            {
                return(curVersion);
            }

            return(resultVersion.ToString());
        }
Example #19
0
        private void GetRoleProgram(string roleID)
        {
            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    this.dtbRoleProg = adminBll.GetRoleProgramByRole(roleID);
                }

                if (this.dtbRoleProg != null)
                {
                    this.grdRoleProgram.DataSource = this.dtbRoleProg;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #20
0
        private void GetRoleList()
        {
            try
            {
                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    this.dtbRole = adminBll.GetRoles(string.Empty);
                }

                if (this.dtbRole != null)
                {
                    this.grdRole.DataSource = this.dtbRole;
                    this.dntRole.DataSource = this.dtbRole;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
        }
Example #21
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            Administrator adm = new Administrator();

            adm.User     = txtUser.Text;
            adm.Passcode = txtPasscode.Text.EncryptPassword();

            AdministratorBLL admBLL = new AdministratorBLL();
            SingleResponse <Administrator> response = admBLL.GetAdm(adm);

            if (response.Success)
            {
                frmHome f = new frmHome();
                f.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Usuário ou senha incorreta.");
            }
        }
Example #22
0
        private void UpdateRole()
        {
            List <RoleProgram> lstRowProgUpd = null;
            Role   role   = null;
            string result = string.Empty;
            string userid = ((frmMainMenu)this.ParentForm).UserID;

            try
            {
                DataRow rowRole = this.dtbRole.Rows[0];
                if (rowRole != null)
                {
                    role = new Role();

                    role.ROLE_ID   = rowRole["ROLE_ID"].ToString().ToUpper();
                    role.ROLE_NAME = rowRole["ROLE_NAME"].ToString();
                    role.REC_STAT  = (bool)rowRole["REC_STAT"];
                }

                if (this.dtbRoleProg.Rows.Count != 0)
                {
                    lstRowProgUpd = new List <RoleProgram>();
                    int         flag = 0;
                    RoleProgram rowProgUpd;
                    foreach (DataRow rowProg in this.dtbRoleProg.Rows)
                    {
                        flag = Convert.ToInt32(rowProg["FLAG"], NumberFormatInfo.CurrentInfo);
                        if (flag == 2)
                        {
                            rowProgUpd          = new RoleProgram();
                            rowProgUpd.ROLE_ID  = rowProg["ROLE_ID"].ToString();
                            rowProgUpd.PROG_ID  = rowProg["PROG_ID"].ToString();
                            rowProgUpd.REC_STAT = (bool)rowProg["REC_STAT"];
                            lstRowProgUpd.Add(rowProgUpd);
                        }
                    }
                }

                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.UpdateRole(role, userid);
                    if (lstRowProgUpd != null)
                    {
                        adminBll.UpdateRoleProgram(lstRowProgUpd, userid);
                    }
                }

                if (result.Equals("OK"))
                {
                    NotifierResult.Show("Update Complete", "Result", 50, 1000, 50, NotifyType.Safe);
                }
                else
                {
                    NotifierResult.Show(result, "Error", 100, 1000, 0, NotifyType.Warning);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                this.GetRoleList();

                this.FormState = eFormState.ReadOnly;

                this.dntRole.Position = this.positionIndex;

                this.btnAddNew.Visible = true;
                this.btnExit.Visible   = true;

                //Reload Menu
                if (lstRowProgUpd != null)
                {
                    ((frmMainMenu)this.ParentForm).ReloadMenu();
                }
            }
        }
Example #23
0
        private void InitializeMenu()
        {
            using (AdministratorBLL adminBLL = new AdministratorBLL())
            {
                List <MenuAuthentication> menuList = adminBLL.GetMenuAuthentication(this.UserID);
                if (menuList == null)
                {
                    return;
                }

                string newGroup = "";

                NavBarGroup menuGroup = new NavBarGroup();
                NavBarItem  menuItem;
                Bitmap      img = null;

                this.navBarControl1.BeginUpdate();
                this.navBarControl1.Groups.Clear();


                foreach (MenuAuthentication menu in menuList)
                {
                    if (newGroup != menu.ProgramType)
                    {
                        menuGroup = this.navBarControl1.Groups.Add();
                        //Create Group
                        menuGroup.Name                 = menu.ProgramType;
                        menuGroup.Caption              = menu.ProgramTypeName;
                        menuGroup.Appearance.Font      = UiUtility.MenuGroupFont();
                        menuGroup.GroupCaptionUseImage = NavBarImage.Small;

                        img = base.Language.GetBitmap(menu.ProgramTypeImage);
                        if (img != null)
                        {
                            menuGroup.SmallImage = img;
                        }
                        //menuGroup.GroupStyle = NavBarGroupStyle.LargeIconsText;
                        menuGroup.GroupStyle = NavBarGroupStyle.SmallIconsText;

                        newGroup = menu.ProgramType;
                    }

                    menuItem         = new NavBarItem();
                    menuItem.Name    = menu.ProgramID + "_" + menu.ProgramKey;
                    menuItem.Hint    = menu.ProgramName;
                    menuItem.Caption = menu.ProgramName;
                    // menuItem.Appearance.Font = UiUtility.MenuItemFont();

                    img = base.Language.GetBitmap(menu.IconImage);
                    if (img != null)
                    {
                        menuItem.SmallImage = img;
                    }


                    menuItem.LinkClicked += new NavBarLinkEventHandler(this.MenuItem_LinkClicked);

                    menuGroup.ItemLinks.Add(menuItem);
                }


                menuGroup = this.navBarControl1.Groups.Add();
                //Create Group
                menuGroup.Name                 = "mnuLogOff";
                menuGroup.Caption              = "LOG OFF";
                menuGroup.Appearance.Font      = UiUtility.MenuGroupFont();
                menuGroup.GroupCaptionUseImage = NavBarImage.Small;

                img = base.Language.GetBitmap("LogOff");
                if (img != null)
                {
                    menuGroup.SmallImage = img;
                }

                menuGroup.GroupStyle = NavBarGroupStyle.Default;
                this.navBarControl1.EndUpdate();
            }
        }
        private void UpdateProgramType()
        {
            ProgramType programType = null;
            string      result      = string.Empty;

            try
            {
                DataRow rowProgramType = this.dtbProgramType.Rows[0];
                if (rowProgramType != null)
                {
                    programType = new ProgramType();

                    programType.PROG_TYPE      = rowProgramType["PROG_TYPE"].ToString().ToUpper();
                    programType.PROG_TYPE_NAME = rowProgramType["PROG_TYPE_NAME"].ToString();
                    programType.REC_STAT       = (bool)rowProgramType["REC_STAT"];

                    if (!rowProgramType["ORDER_BY"].GetType().Equals(typeof(System.DBNull)))
                    {
                        programType.ORDER_BY = Convert.ToInt32(rowProgramType["ORDER_BY"].ToString());
                    }
                    programType.ICON = rowProgramType["ICON"].ToString();
                }

                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.UpdateProgramType(programType, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (result.Equals("OK"))
                {
                    NotifierResult.Show("Update Complete", "Result", 50, 1000, 50, NotifyType.Safe);
                }
                else
                {
                    NotifierResult.Show(result, "Error", 100, 1000, 0, NotifyType.Warning);
                }
            }
            catch (Exception ex)
            {
                NotifierResult.Show(ex.Message, "Error", 50, 1000, 0, NotifyType.Warning);
            }
            finally
            {
                this.GetProgramTypeList();

                this.FormState = eFormState.ReadOnly;

                if (result.Equals("OK"))
                {
                    GridView viewList = (GridView)this.grdProgramType.Views[0];
                    viewList.ClearSorting();
                    int position = UiUtility.GetRowHandleByColumnValue(viewList, "PROG_TYPE", programType.PROG_TYPE);
                    if (position != 0)
                    {
                        if (position != GridControl.InvalidRowHandle)
                        {
                            this.dntProgramType.Position = position;
                        }
                    }
                    else
                    {
                        viewList.FocusedRowHandle = 0;
                    }
                }

                this.btnAddNew.Visible = true;
                this.btnExit.Visible   = true;
            }
        }
Example #25
0
        private void UpdateUser()
        {
            string result = string.Empty;

            try
            {
                User user = new User();

                user.USER_ID   = (string)this.txtUSER_ID.EditValue;
                user.USER_NAME = (string)this.txtUSER_NAME.EditValue;
                user.WARE_ID   = (string)this.txtWARE_ID.EditValue;
                user.LOGIN     = (string)this.txtLOGIN.EditValue;

                user.PWD = (string)this.txtPWD.EditValue;

                user.EMPLOYEE_ID = (string)UiUtility.IsNullValue(this.txtEMPLOYEE_ID.EditValue, "");
                user.ROLE_ID     = (string)this.lueDefaultRole.EditValue;

                user.REMARK   = (string)UiUtility.IsNullValue(this.txtREMARK.EditValue, "");
                user.EMAIL    = (string)UiUtility.IsNullValue(this.txtEMAIL.EditValue, "");
                user.COMP_ID  = (string)UiUtility.IsNullValue(this.txtCOMP_ID.EditValue, "");
                user.REC_STAT = (bool)this.icbREC_STAT.EditValue;


                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.UpdateUser(user, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (result.Equals("OK"))
                {
                    this.UpdateUserRole();

                    GridView view = (GridView)this.grdUserList.Views[0];
                    view.BeginDataUpdate();

                    view.SetFocusedRowCellValue("USER_ID", user.USER_ID);
                    view.SetFocusedRowCellValue("USER_NAME", user.USER_NAME);
                    view.SetFocusedRowCellValue("WARE_ID", user.WARE_ID);
                    view.SetFocusedRowCellValue("EMPLOYEE_ID", user.EMPLOYEE_ID);
                    view.SetFocusedRowCellValue("ROLE_ID", user.ROLE_ID);
                    view.SetFocusedRowCellValue("EMAIL", user.EMAIL);
                    view.SetFocusedRowCellValue("REC_STAT", user.REC_STAT);

                    view.EndDataUpdate();

                    NotifierResult.Show("Update Complete", "Result", 50, 1000, 50, NotifyType.Safe);
                }
                else
                {
                    NotifierResult.Show(result, "Error", 100, 1000, 0, NotifyType.Warning);
                }
            }
            catch (Exception ex)
            {
                NotifierResult.Show(ex.Message, "Error", 50, 1000, 0, NotifyType.Warning);
            }
            finally
            {
                this.FormState = eFormState.ReadOnly;
            }
        }
Example #26
0
        private void InsertUser()
        {
            string result = string.Empty;

            try
            {
                User user = new User();

                user.USER_ID     = (string)this.txtUSER_ID.EditValue;
                user.USER_NAME   = (string)this.txtUSER_NAME.EditValue;
                user.WARE_ID     = (string)this.txtWARE_ID.EditValue;
                user.LOGIN       = (string)this.txtLOGIN.EditValue;
                user.PWD         = (string)this.txtPWD.EditValue;
                user.EMPLOYEE_ID = (string)UiUtility.IsNullValue(this.txtEMPLOYEE_ID.EditValue, "");
                user.ROLE_ID     = (string)this.lueDefaultRole.EditValue;

                user.REMARK   = (string)UiUtility.IsNullValue(this.txtREMARK.EditValue, "");
                user.EMAIL    = (string)UiUtility.IsNullValue(this.txtEMAIL.EditValue, "");
                user.COMP_ID  = (string)UiUtility.IsNullValue(this.txtCOMP_ID.EditValue, "");
                user.REC_STAT = (bool)this.icbREC_STAT.EditValue;

                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.InsertUser(user, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (result.Equals("OK"))
                {
                    this.UpdateUserRole();
                    NotifierResult.Show("Insert Complete", "Result", 50, 1000, 50, NotifyType.Safe);
                }
                else
                {
                    NotifierResult.Show(result, "Error", 100, 1000, 0, NotifyType.Warning);
                }
            }
            catch (Exception ex)
            {
                NotifierResult.Show(ex.Message, "Error", 100, 1000, 0, NotifyType.Warning);
            }
            finally
            {
                this.FormState = eFormState.ReadOnly;
                //Get all Invoice on Invoice List
                this.GetUserList();

                if (result.Equals("OK"))
                {
                    GridView viewList = (GridView)this.grdUserList.Views[0];
                    viewList.ClearSorting();
                    int position = UiUtility.GetRowHandleByColumnValue(viewList, "USER_ID", this.txtUSER_ID.Text);
                    if (position != 0)
                    {
                        if (position != GridControl.InvalidRowHandle)
                        {
                            this.dntUser.Position = position;
                        }
                    }
                    else
                    {
                        viewList.FocusedRowHandle = 0;
                    }
                }
            }
        }
Example #27
0
 public AdminLoginController(AdministratorBLL bll)
 {
     _bll = bll;
 }
Example #28
0
        private void UpdateProgram()
        {
            string result = string.Empty;

            try
            {
                M_Program program = new M_Program();

                program.PROG_ID   = (string)this.txtPROG_ID.EditValue;
                program.PROG_NAME = (string)UiUtility.IsNullValue(this.txtPROG_NAME.EditValue, "");
                program.PROG_KEY  = (string)UiUtility.IsNullValue(this.txtPROG_KEY.EditValue, "");
                program.PROG_TYPE = (string)this.luePROG_TYPE.EditValue;
                if (this.txtORDER_BY.EditValue != null)
                {
                    program.ORDER_BY = (int)this.txtORDER_BY.EditValue;
                }

                program.ICON        = (string)UiUtility.IsNullValue(this.txtICON.EditValue, "");
                program.DESCRIPTION = (string)UiUtility.IsNullValue(this.txtDESCRIPTION.EditValue, "");
                program.REC_STAT    = (bool)this.icbREC_STAT.EditValue;



                using (AdministratorBLL adminBll = new AdministratorBLL())
                {
                    result = adminBll.UpdateProgram(program, ((frmMainMenu)this.ParentForm).UserID);
                }

                if (result.Equals("OK"))
                {
                    GridView view = (GridView)this.grdProgramList.Views[0];
                    view.BeginDataUpdate();

                    view.SetFocusedRowCellValue("PROG_ID", program.PROG_ID);
                    view.SetFocusedRowCellValue("PROG_NAME", program.PROG_NAME);
                    view.SetFocusedRowCellValue("PROG_TYPE", program.PROG_TYPE);
                    view.SetFocusedRowCellValue("ORDER_BY", program.ORDER_BY);
                    view.SetFocusedRowCellValue("REC_STAT", program.REC_STAT);

                    view.EndDataUpdate();

                    NotifierResult.Show("Update Complete", "Result", 50, 1000, 50, NotifyType.Safe);
                }
                else
                {
                    NotifierResult.Show(result, "Error", 100, 1000, 0, NotifyType.Warning);
                }
            }
            catch (Exception ex)
            {
                NotifierResult.Show(ex.Message, "Error", 50, 1000, 0, NotifyType.Warning);
            }
            finally
            {
                this.FormState = eFormState.ReadOnly;
                //Get all Invoice on Invoice List
                this.lueProgramType.EditValue = this.luePROG_TYPE.EditValue;

                this.GetProgramList(this.lueProgramType.EditValue.ToString(), string.Empty);

                if (result.Equals("OK"))
                {
                    GridView viewList = (GridView)this.grdProgramList.Views[0];
                    viewList.ClearSorting();
                    int position = UiUtility.GetRowHandleByColumnValue(viewList, "PROG_ID", this.txtPROG_ID.Text);
                    if (position != 0)
                    {
                        if (position != GridControl.InvalidRowHandle)
                        {
                            this.dntProgram.Position = position;
                        }
                    }
                    else
                    {
                        viewList.FocusedRowHandle = 0;
                    }

                    //Reload Menu
                    ((frmMainMenu)this.ParentForm).ReloadMenu();
                }
            }
        }