Beispiel #1
0
        public static AppUserDetails SetAppUserDetails(string username)
        {
            string sql = "SELECT U.UserID, U.UserName, U.DistrictID, U.PartnerID, D.DistrictName, UT.UserTypeCode, U.FullName, U.SaMIOrganizationID " +
                            "FROM tbl_users AS U " +
                            "JOIN tbl_districts AS D ON D.DistrictID = U.DistrictID " +
                            "JOIN tbl_user_types UT ON UT.UserTypeID = U.UserTypeID " +
                            "LEFT JOIN tbl_stakeholders SH ON SH.StakeHolderID = U.PartnerID " +
                            "LEFT JOIN tbl_SaMI_organizations SO ON SO.SaMIOrganizationID = U.SaMIOrganizationID " +
                            "WHERE UserName = '******'";
            DataView dv = new UserDAO().ExecuteQuery(sql);

            AppUserDetails objAppUserDetails = null;

            if (dv.Table.Rows.Count > 0)
            {
                objAppUserDetails = new AppUserDetails();
                objAppUserDetails.UserID = (int)dv.Table.Rows[0]["UserID"];
                objAppUserDetails.DistrictID = (int)dv.Table.Rows[0]["DistrictID"];
                objAppUserDetails.PartnerID = (int)dv.Table.Rows[0]["PartnerID"];
                objAppUserDetails.UserType = dv.Table.Rows[0]["UserTypeCode"].ToString();
                objAppUserDetails.FullName = dv.Table.Rows[0]["FullName"].ToString();
                objAppUserDetails.DistrictName = dv.Table.Rows[0]["DistrictName"].ToString();
                if (dv.Table.Rows[0]["SaMIOrganizationID"] != DBNull.Value)
                    objAppUserDetails.SaMIOrganizationID = (int)dv.Table.Rows[0]["SaMIOrganizationID"];
                else
                    objAppUserDetails.SaMIOrganizationID = 0;
            }

            return objAppUserDetails;
        }
Beispiel #2
0
        public static Boolean CheckLogin(string username, string password)
        {
            Boolean blnLogin = false;
            DataView dv = new UserDAO().CheckLogin(username, AppCommonBO.EncodeUserPassword(password));
            if (dv.Table.Rows.Count > 0)
                blnLogin = true;

            return blnLogin;
        }
Beispiel #3
0
        public static Boolean CheckUserAuthentication(string username, string password)
        {
            Boolean blnLogin = false;
            DataView dv = new UserDAO().CheckUserAuthentication(username, password);
            if (dv.Table.Rows.Count > 0)
                blnLogin = true;

            return blnLogin;
        }
Beispiel #4
0
        public static Boolean IsUserExists(string UserName)
        {
            Boolean blnExists = false;

            DataView dv = new UserDAO().Select("UserName", "", "UserName = '******'");

            if (dv.Count > 0)
                blnExists = true;

            return blnExists;
        }