public ActionResult Index() { try { ViewData["CityCircle"] = context.SpgetProspectingselectlist().Select(xx => new SelectListItem { Value = xx.listid.ToString(), Text = xx.listname }).ToList(); ViewData["Titlelist"] = context.SPgettitle().Select(xx => new SelectListItem { Value = xx.ToString(), Text = xx.ToString() }).ToList(); ViewData["Templatelist"] = context.SpGetEmailtemplatelist().Select(xx => new SelectListItem { Value = xx.TemplateId.ToString(), Text = xx.TemplateName.ToString() }).ToList(); if (TempData["Message"] != null) { ViewBag.Message = TempData["Message"]; } } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "EmailSendFrom" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View()); }
public JsonResult Save_List(string ListName, string restricted) { string str = ""; try { byte res = 0; if (restricted == "Yes") { res = 1; } else { res = 0; } var countlst = context.Prospecting_Lists.Where(x => x.listname == ListName).Count(); var username = User.Identity.Name; if (countlst == 0) { context.SPInsertProspectlist(ListName, res, username); context.SaveChanges(); str = "Success"; } else { str = "List already exist"; } } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectListsClient" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Save_List", "NA", "NA", "NA", "WEB"); str = "Error Occured"; } return(Json(str, JsonRequestBehavior.AllowGet)); }
public ActionResult Index() { var emaillist = new List <SpGetEmailtemplatelist_Result>(); try { emaillist = context.SpGetEmailtemplatelist().ToList(); } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "EmailTemplate" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View(emaillist)); }
public ActionResult Index() { try { if (TempData["msg"] != null) { ViewBag.Message = TempData["msg"]; } var rolecount = context.SpgetRoles(Roles.ApplicationName).ToList(); ViewBag.rolecountdata = rolecount; } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ManageRoles" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View()); }
public ActionResult ForgotPassword(ForgotPasswordViewModel model) { if (ModelState.IsValid) { try { MembershipUser CurrentUser = Membership.GetUser(model.Email); if (CurrentUser != null) { var userid = CurrentUser.ProviderUserKey; var callbackUrl = Url.Action("ResetPassword", "ForgotPassWord", new { userIdval = userid }, protocol: Request.Url.Scheme); //Send reset password email string varificationMsg = "Dear UserName,<br/>"; varificationMsg += "Your link to reset password is<br/>"; varificationMsg += "<a target='_blank' href=" + callbackUrl + ">Please Click on the link to reset password</a>"; varificationMsg += "<br/>Regards!<br/>"; varificationMsg += "StaffandTrain"; string body = varificationMsg; body = body.Replace("resetpasswordlink", callbackUrl); string UserName = CurrentUser.UserName; body = body.Replace("UserName", UserName); sm.SendToEmail("Reset Password", body, "*****@*****.**"); TempData["Msg"] = "Reset Password link has been sent to your email"; } else { TempData["Msg"] = "User not exist"; } //await UserManager.SendEmailAsync(user.Id, "Reset Password", "Please reset your password by clicking <a href=\"" + callbackUrl + "\">here</a>"); } catch (Exception ex) { TempData["Msg"] = "Error"; cm.ErrorExceptionLogingByService(ex.ToString(), "ForgotPassWord" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "ForgotPassWord", "NA", "NA", "NA", "WEB"); } return(RedirectToAction("Index")); } // If we got this far, something failed, redisplay form return(View(model)); }
// GET: ManageUser public ActionResult Index() { var userlist = new List <Spgetusers_Result>(); try { userlist = context.Spgetusers().ToList(); ViewData["City"] = context.SPgetProspectinglists().Select(xx => new SelectListItem { Value = xx.listid.ToString(), Text = xx.listname + " /User Count" + xx.Cnt }).ToList(); if (TempData["Message"] != null) { ViewBag.message = TempData["Message"]; } } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ManageUser" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View(userlist)); }
// GET: ProspectViewListClient public ActionResult Index(int listid, string lstname) { try { if (listid != 0) { if (TempData["Message"] != null) { ViewBag.message = TempData["Message"]; } ViewBag.listid = listid; var listname = context.Prospecting_Lists.Where(x => x.listid == listid).FirstOrDefault().listname; ViewBag.listname = listname; var citycirclelist = context.SPgetCitycirclelist(listid).Select(xx => new SelectListItem { Value = xx.ToString(), Text = xx.ToString() }).ToList(); var Biztypelist = context.SPgetbiztype(listid).Select(xx => new SelectListItem { Value = xx.ToString(), Text = xx.ToString() }).ToList(); var Titlelist = context.SPgettitle().Select(xx => new SelectListItem { Value = xx.ToString(), Text = xx.ToString() }).ToList(); ViewData["citycirclelist"] = citycirclelist; ViewData["Biztypelist"] = Biztypelist; ViewData["Titlelist"] = Titlelist; } else { return(RedirectToAction("Index", "ProspectListsClient")); } } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectViewListClient" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View()); }
public ActionResult Index() { try { var citycirclelist = context.Spgetcitycircleemail().Select(xx => new SelectListItem { Value = xx.ToString(), Text = xx.ToString() }).ToList(); var Biztypelist = context.Spgetbiztypeemail().Select(xx => new SelectListItem { Value = xx.ToString(), Text = xx.ToString() }).ToList(); var Titlelist = context.SPgettitle().Select(xx => new SelectListItem { Value = xx.ToString(), Text = xx.ToString() }).ToList(); ViewData["citycirclelist"] = citycirclelist; ViewData["Biztypelist"] = Biztypelist; ViewData["Titlelist"] = Titlelist; } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectFilterList" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View()); }
// GET: AdminHome public ActionResult Index() { var userlist = new List <GetNewUsers_Result>(); try { userlist = context.GetNewUsers(Roles.ApplicationName, 20, 30).ToList(); var rolecount = context.SpgetRoles(Roles.ApplicationName).Where(x => x.UserCount != 0).ToList(); ViewBag.rolecountdata = rolecount; } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "AdminHome" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View(userlist)); }
// GET: RecruiterProspect Not in use public ActionResult Index() { var ProspectList = new List <SPGetProspectlist_Result>(); try { if (TempData["Message"] != null) { ViewBag.message = TempData["Message"]; } ProspectList = context.SPGetProspectlist().ToList(); } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "RecruiterProspect" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View(ProspectList)); }
// GET: WhiteBoards public ActionResult Index() { var WhiteboardList = new List <WhiteBoardName>(); try { WhiteboardList = context.WhiteBoardNames.Where(p => p.AllowRecruiter != true).ToList(); } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "WhiteBoards" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View(WhiteboardList)); }
public JsonResult GetCompanyList(int listid, string citycircle, string biztype, string title, string name, string Notes) { var prospectviewlist = new List <SpgetProspectViewList_Result>(); if (TempData["compnyid"] != null && TempData["compnyid"].ToString() != "") { ViewBag.cmpnyid = TempData["compnyid"]; } var complist = new List <CompanyModel>(); try { List <string> titlelist = new List <string>(); Notes = Notes.Replace(" ", ""); if (!string.IsNullOrEmpty(title)) { if (title == "Manager") { titlelist.Add("CEO"); titlelist.Add("EXEC"); titlelist.Add("Manager"); titlelist.Add("HR"); } else { titlelist.Add(title); } } if (listid != 0 && string.IsNullOrEmpty(citycircle) && string.IsNullOrEmpty(biztype) && string.IsNullOrEmpty(title) && string.IsNullOrEmpty(name) && string.IsNullOrEmpty(Notes)) { var data = context.SpgetProspectViewList(listid).ToList(); prospectviewlist = data; return(Json(prospectviewlist, JsonRequestBehavior.AllowGet)); } else if (listid != 0 || !string.IsNullOrEmpty(citycircle) || !string.IsNullOrEmpty(biztype) || !string.IsNullOrEmpty(title)) { var data = (from com in context.Companies join con in context.Contacts on com.companyid equals con.companyid into gj from x in gj.DefaultIfEmpty() where com.listid == listid && ((citycircle == null || citycircle == "") || com.citycircle == citycircle) && ((biztype == null || biztype == "") || com.biztype == biztype) && ((title == null || title == "") || titlelist.Contains(x.titlestandard)) && ((name == null || name == "") || (x.contactfullname.Contains(name)) || (com.name.ToUpper().Contains(name.ToUpper()))) && ((Notes == null || Notes == "") || x.combinednotes.Trim().Replace("\r", "").Replace("\n", "").Replace(System.Environment.NewLine, "").Replace(" ", "").Contains(Notes)) select new { com.companyid, com.listid, com.citycircle, com.biztype, com.name, com.addr1, com.addr2, com.city, com.state, com.zip, com.weburl, com.phone, com.priority, com.target, x.combinednotes }).Distinct().OrderBy(x => x.name).ToList(); foreach (var i in data) { CompanyModel objcomp = new CompanyModel(); objcomp.companyid = @i.companyid; objcomp.listid = @i.listid; objcomp.citycircle = @i.citycircle; objcomp.biztype = @i.biztype; objcomp.name = @i.name; objcomp.addr1 = @i.addr1; objcomp.addr2 = @i.addr2; objcomp.city = @i.city; objcomp.state = @i.state; objcomp.zip = @i.zip; objcomp.weburl = @i.weburl; objcomp.phone = @i.phone; if (@i.priority == null) { objcomp.priority = false; } else { objcomp.priority = Convert.ToBoolean(@i.priority); } if (@i.target == null) { objcomp.priority = false; } else { objcomp.target = Convert.ToBoolean(@i.target); } objcomp.combinednotes = @i.combinednotes; if (complist.Where(x => x.companyid == objcomp.companyid).Count() == 0) { complist.Add(objcomp); } } return(Json(complist, JsonRequestBehavior.AllowGet)); //return View("GetCompanyListNew", complist); //return RedirectToAction("Index", "ProspectListsAdmin"); } } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectViewList" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "GetCompanyList", "NA", "NA", "NA", "WEB"); } return(Json(prospectviewlist, JsonRequestBehavior.AllowGet)); //return View("GetCompanyListNew", prospectviewlist); }
public ActionResult Index(string Compid) { if (string.IsNullOrEmpty(Compid)) { return(RedirectToAction("Index", "ProspectListsClient")); } CompContact objcomp = new CompContact(); try { int CompidIddecrypt = Convert.ToInt32(CryptorEngine.Decrypt(cm.Code_Decrypt(Convert.ToString(Compid)))); var data = context.SPgetCompdetailsbycompid(CompidIddecrypt).FirstOrDefault(); if (data != null) { objcomp.name = data.name; objcomp.biztype = data.biztype; objcomp.addr2 = data.addr2; objcomp.addr1 = data.addr1; objcomp.weburl = data.weburl; if (data.weburl != "" && data.weburl != null) { if (!data.weburl.Contains("http://") || !data.weburl.Contains("https://")) { objcomp.weburl = "http://" + data.weburl; } } objcomp.city = data.city; objcomp.state = data.state; objcomp.zip = data.zip; if (data.target == null) { objcomp.target = false; } else { objcomp.target = Convert.ToBoolean(data.target); } if (data.priority == null) { objcomp.priority = false; } else { objcomp.priority = Convert.ToBoolean(data.priority); } objcomp.phone = data.phone; objcomp.citycircle = data.citycircle; objcomp.listid = data.listid; objcomp.companyid = CompidIddecrypt; var CompContacts = context.SpGetContactlistbyCompid(CompidIddecrypt, objcomp.listid).ToList(); if (CompContacts != null) { foreach (var i in CompContacts) { ContactDetails objcondetails = new ContactDetails(); objcondetails.contactid = i.contactid; objcondetails.companyid = i.companyid; objcondetails.contactfullname = i.contactfullname; objcondetails.titlestandard = i.titlestandard; objcondetails.contactphone = i.contactphone; objcondetails.contactcellphone = i.contactcellphone; objcondetails.contactemail = i.contactemail; objcondetails.listid = i.listid; objcondetails.linkedinprofileurl = i.linkedinprofileurl; objcondetails.combinednotes = i.combinednotes; objcondetails.contactemail = i.contactemail; } } } var Complst = context.SPgetCompanies(objcomp.listid).ToList().Select(xx => new SelectListItem { Value = xx.companyid.ToString(), Text = xx.name + " - Business Type : " + xx.biztype }).ToList(); ViewData["Complst"] = Complst; if (TempData["ConEmail"] != null) { ViewBag.ConEmail = TempData["ConEmail"]; } } catch (Exception ex) { cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectViewCompanyClient" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(View(objcomp)); }
public ActionResult UserLogin(LoginViewModel objlogin) { try { if (Membership.ValidateUser(objlogin.Email, objlogin.Password)) { MembershipUser CurrentUser = Membership.GetUser(objlogin.Email); if (CurrentUser.IsApproved) { var roleslist = Roles.GetRolesForUser(objlogin.Email); var userrole = roleslist.FirstOrDefault(); Global.Role = userrole; Global.UserName = objlogin.Email; FormsAuthentication.SetAuthCookie(objlogin.Email, true); //#region Remember Me //HttpCookie unm = new HttpCookie("unm", objlogin.Email); //HttpCookie pas = new HttpCookie("pas", objlogin.Password); //HttpCookie rem = new HttpCookie("rem", objlogin.RememberMe.ToString()); //if (objlogin.RememberMe) //{ // unm.Expires = DateTime.Now.AddDays(15); // pas.Expires = DateTime.Now.AddDays(15); // rem.Expires = DateTime.Now.AddDays(15); //} //else //{ // unm.Expires = DateTime.Now.AddDays(-1); // pas.Expires = DateTime.Now.AddDays(-1); // rem.Expires = DateTime.Now.AddDays(-1); //} //System.Web.HttpContext.Current.Response.Cookies.Add(unm); //System.Web.HttpContext.Current.Response.Cookies.Add(pas); //System.Web.HttpContext.Current.Response.Cookies.Add(rem); //#endregion //FormsAuthentication.SetAuthCookie(objlogin.Email, false); if (userrole == "Admin") { return(RedirectToAction("Index", "AdminHome")); } else if (userrole == "Recruiter") { return(RedirectToAction("Index", "RecruiterHome")); } else { return(RedirectToAction("Index", "ClientHome")); } } else { TempData["Msg"] = "User account is not activated yet"; } } else { TempData["Msg"] = "Invalid User"; } } catch (Exception ex) { TempData["Msg"] = "Error"; cm.ErrorExceptionLogingByService(ex.ToString(), "UserLogin" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB"); } return(RedirectToAction("Index")); }