Example #1
0
        public Role FindByRoleID(string username, string password, int id)
        {
            WebServiceAccountsRepository webir       = new WebServiceAccountsRepository();
            WebServiceAccount            currentuser = webir.FindByUserName(username);

            if (currentuser != null)
            {
                if (currentuser.Password == password)
                {
                    RolesRepository depir = new RolesRepository();
                    return(depir.FindByid(id));
                }
                else
                {
                    return(null);
                }
            }

            else
            {
                return(null);
            }
        }
Example #2
0
        public void LoadDepartmentData(string Roleid)
        {
            try
            {
                RolesRepository rrir = new RolesRepository();
                Role            role = rrir.FindByid(Roleid.ToInt());

                if (role != null)
                {
                    lbltitle.Text  = role.RoleTitle;
                    lblRoleid.Text = role.RoleID.ToString();

                    TextBox1.Text = role.RoleTitle;
                }
                else
                {
                    Redirector.Goto(Redirector.PageName.errorpage);
                }
            }
            catch
            {
                Redirector.Goto(Redirector.PageName.errorpage);
            }
        }