예제 #1
0
 public ActionResult PasswordSetting(string id, string code)
 {
     if (!String.IsNullOrEmpty(id.Trim()) && !String.IsNullOrEmpty(code.Trim()))
     {
         try
         {
             objBLLSchoolUser = new BLLSchoolUser();
             DataTable aMerchantUser = new DataTable();
             aMerchantUser = objBLLSchoolUser.MerchantPasswordRecovery(EncryptDecrypt.Decrypt(id), EncryptDecrypt.Decrypt(code));
             if (aMerchantUser.Rows.Count > 0)
             {
                 objModelSchoolUserAccount           = new ModelSchoolUserAccount();
                 objModelSchoolUserAccount.UserEmail = aMerchantUser.Rows[0]["UserEmail"].ToString();
                 return(View(objModelSchoolUserAccount));
             }
             else
             {
                 Error("Link expired or no user found,Please try again to Recover your password");
             }
             return(RedirectToAction("Login", "User"));
         }
         catch (Exception ex)
         {
             DALUtility.ErrorLog(ex.Message, "UserController, PasswordSetting");
         }
     }
     else
     {
         Error("Link expired or no user found,Please try again to Recover your password");
     }
     return(RedirectToAction("Login", "User"));
 }
예제 #2
0
        //
        // GET: /User/Home

        public ActionResult Home()
        {
            if (Session[DALVariables.UserAccountId] == null)
            {
                return(RedirectToAction("Login", "User"));
            }
            objBLLMerchantPages       = new BLLMerchantPages();
            objModelSchoolUserAccount = new ModelSchoolUserAccount();
            DataTable merchantData = new DataTable();

            merchantData = objBLLMerchantPages.GetMerchantAPIKey(Convert.ToDecimal(Session[DALVariables.UserAccountId]));
            if (merchantData.Rows.Count > 0)
            {
                //objModelSchoolUserAccount.MerchantKey = merchantData.Rows[0]["MerchantKey"].ToString();
                //objModelSchoolUserAccount.MerchantReferenceID = merchantData.Rows[0]["MerchantReferenceID"].ToString();
            }
            return(View(objModelSchoolUserAccount));
        }
예제 #3
0
        public ActionResult Login(string SchoolAccountId, string UserEmail, string UserPassword)
        {
            if (ModelState.IsValid)
            {
                if (string.IsNullOrEmpty(UserEmail.Trim()))
                {
                    Error("User Email not filled not correctly");
                    //ModelState.AddModelError("", "UserEmail not filled not correctly");
                    return(View());
                }
                else if (string.IsNullOrEmpty(UserPassword.Trim()))
                {
                    Error("Must fill password field");
                    //ModelState.AddModelError("", "Must fill password field");
                    return(View());
                }

                try
                {
                    ModelSchoolUserAccount objSchoolUserAccount = new ModelSchoolUserAccount();
                    DataTable userDetails = new DataTable();
                    userDetails = objBLLSchoolUser.GetSchoolUserDetailsByLogin(SchoolAccountId, UserEmail.Trim(), UserPassword.Trim());
                    if (userDetails.Rows.Count > 0)
                    {
                        objSchoolUserAccount.SchoolAccountId  = Convert.ToInt32(userDetails.Rows[0]["SchoolAccountId"]);
                        objSchoolUserAccount.UserAccountId    = Convert.ToInt32(userDetails.Rows[0]["UserAccountId"]);
                        objSchoolUserAccount.UserFName        = Convert.ToString(userDetails.Rows[0]["UserFName"]);
                        objSchoolUserAccount.UserLName        = Convert.ToString(userDetails.Rows[0]["UserLName"]);
                        objSchoolUserAccount.UserEmail        = Convert.ToString(userDetails.Rows[0]["UserEmail"]);
                        objSchoolUserAccount.UserProfileImage = Convert.ToString(userDetails.Rows[0]["UserProfileImage"]);
                        objSchoolUserAccount.UseAccountStatus = Convert.ToInt32(userDetails.Rows[0]["UseAccountStatus"]);
                        objSchoolUserAccount.SchoolAccount.SchoolProfileLogo = Convert.ToString(userDetails.Rows[0]["UserProfileImage"]);

                        if (objSchoolUserAccount.UseAccountStatus == 2)
                        {
                            return(RedirectToAction("AccountInfo", "User"));
                        }
                        else if (objSchoolUserAccount.UseAccountStatus == 4)
                        {
                            return(RedirectToAction("AccountBlocked", "User"));
                        }
                        else if (objSchoolUserAccount.UseAccountStatus == 3)
                        {
                            Session[DALVariables.SchoolAccountId]   = objSchoolUserAccount.SchoolAccountId;
                            Session[DALVariables.UserAccountId]     = objSchoolUserAccount.UserAccountId;
                            Session[DALVariables.UserName]          = objSchoolUserAccount.UserFName + " " + objSchoolUserAccount.UserLName;
                            Session[DALVariables.UserEmail]         = objSchoolUserAccount.UserEmail;
                            Session[DALVariables.SchoolProfileLogo] = objSchoolUserAccount.SchoolAccount.SchoolProfileLogo;
                            Session[DALVariables.ProfileImage]      = objSchoolUserAccount.UserProfileImage;
                            Session[DALVariables.AccountType]       = 2;

                            return(RedirectToAction("Home", "User"));
                        }
                        else
                        {
                            return(RedirectToAction("AccountPendingVerify", "User"));
                        }
                    }
                    Error("No User Found ! , Re-check login details");
                    //ModelState.AddModelError("", "No User Found ! , Re-check login details");
                    return(View());
                }
                catch (Exception ex)
                {
                    DALUtility.ErrorLog(ex.Message, "UserController, Login");
                }
            }
            else
            {
                Error("No User Found ! , Re-check login details");
                //ModelState.AddModelError("", "Fill form Correctly; Please correct to continue!");
            }
            return(View());
        }
예제 #4
0
        //
        // GET: /User/Login

        public ActionResult Login()
        {
            objModelSchoolUserAccount = new ModelSchoolUserAccount();
            return(View(objModelSchoolUserAccount));
        }