public ActionResult ChannelList() { if (Session["username"] == null) { BO_Employee obj = new BO_Employee(); return(RedirectToAction("Index", "Home")); } List <BO_Message_Recipients_Status> li = new List <BO_Message_Recipients_Status>(); try { BO_Message_Recipients_Status MSR_Result = new BO_Message_Recipients_Status(); MSR_Result = DA_Login.DA_MessageRecipientStatus(); if (MSR_Result.msg != null) { ViewBag.Exception = MSR_Result.msg; } // MSR_Result = DB.Channellist(); li.Add(MSR_Result); } catch (Exception e) { ViewBag.Exception = e; } return(View("ChannelList", "_Layout", li)); }
protected bool CustomerLogin(string login, string pass) { DA_Login Log = new DA_Login(); DataTable dt = new DataTable(); objLogin.Username = login; objLogin.Password = pass; dt = objLoginDB.GetDataSet(objLogin, DA_SKORKEL.DA_Login.Login_1.GmailFBLogin); if (dt.Rows.Count > 0) { UserSession.UserInfo UInfo = new UserSession.UserInfo(); string LoginName = Convert.ToString(dt.Rows[0]["LoginName"]); UInfo.UserName = Convert.ToString(dt.Rows[0]["vchrUserName"]); UInfo.UserID = Convert.ToInt64(dt.Rows[0]["intRegistrationId"]); int TypeId = Convert.ToInt32(dt.Rows[0]["intUserTypeID"]); Session.Add("UserTypeId", TypeId); Session.Add("UInfo", UInfo); Session.Add("LoginName", LoginName); Session.Add("ExternalUserId", Convert.ToString(dt.Rows[0]["intRegistrationId"])); return(true); } else { return(false); } }
protected bool CustomerLogin(string login, string pass) { DA_Login Log = new DA_Login(); DataTable dt = new DataTable(); objLogin.Username = login; objLogin.Password = pass; dt = objLoginDB.GetDataSet(objLogin, DA_SKORKEL.DA_Login.Login_1.GmailFBLogin); if (dt.Rows.Count > 0) { //if (login == "") //{ UserSession.UserInfo UInfo = new UserSession.UserInfo(); string LoginName = Convert.ToString(dt.Rows[0]["LoginName"]); UInfo.UserName = Convert.ToString(dt.Rows[0]["vchrUserName"]); UInfo.UserID = Convert.ToInt64(dt.Rows[0]["intRegistrationId"]); int TypeId = Convert.ToInt32(dt.Rows[0]["intUserTypeID"]); Session.Add("UserTypeId", TypeId); Session.Add("UInfo", UInfo); Session.Add("LoginName", LoginName); Session.Add("ExternalUserId", Convert.ToString(dt.Rows[0]["intRegistrationId"])); //Response.Redirect("~/Profile/SkorkelSearch.aspx?Content=" + txtSearchScorkel.Text.Trim()); //} return(true); } else { return(false); } }
public ActionResult Login(LoginCredentials login) { /** * UserGroupId UserGroupName * 1 Admin * 2 Parent * 3 Student * 4 Teacher * 5 View */ ExternalUserLogin extuser = DA_Login.GetExternalUser(login); if (extuser != null) { if (extuser.Password != login.Password) { return(View("Index")); } ExternalUserInfo exUserInfo = DA_ExternalUser.GetExternalUserInfo(extuser.ExternalUserInfoID); Session["CurrentUser"] = exUserInfo; int userGroupID = DA_ExternalUser.GetExternalUserGroup(extuser.ExternalUserLoginID).UserGroupId; Session["UserGroupID"] = userGroupID; if (userGroupID == 3) // student { StudentInfo sInfo = DA_Student.GetStudentInfoByLoginID(extuser.ExternalUserLoginID); return(View("~/Views/Student/Index.cshtml", sInfo)); } if (userGroupID == 4) // Teacher { return(View("~/Views/Teacher/Index.cshtml", exUserInfo)); } } else { InternalUser interanlUser = DA_Login.GetInternalUser(login); if (interanlUser != null) { if (interanlUser.Password != login.Password) { return(View("Index")); } Session["CurrentUser"] = interanlUser; Session["UserGroupID"] = interanlUser.UserGroupId; } else { return(View("Index")); } } return(View()); }
public ActionResult login(string empcd, string password) { BO_Employee objResult = new BO_Employee(); try { objResult = DA_Login.DA_LoginEmployee(empcd, password); if (objResult.Empcd != null && objResult.Password != null) { // if (obj.Empcd.Trim() == objResult.Empcd.Trim() && obj.Password.Trim() == objResult.Password.Trim()) if (empcd.Trim() == objResult.Empcd.Trim() && password.Trim() == objResult.Password.Trim()) { // Session["EntryBy"] = obj.Empcd; Session["EntryBy"] = objResult.Empcd; Session["Password"] = objResult.Password; Session["username"] = objResult.Empnm; TempData["success"] = 1; return(RedirectToAction("Home")); //if (objResult.Empcd.Trim() == "A786KEY") //{ // ViewBag.flag = 1; //} // return View("main", "_Layout"); } } ViewBag.fail = 0; } catch (Exception e) { ViewBag.Exception = e; // throw; } return(View("Index")); }