// GET: Project public ActionResult Index() { try { DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - Home Page Loaded ...", "Info"); ProjectInfoViewModel vm = new ProjectInfoViewModel(); DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - View Model Created...", "Info"); DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - HandleRequest called...", "Info"); //if (Session["MyUserId"] != null) { // ViewBag.MyUserId = Session["MyUserId"]; //vm.Entity.User_ID = Convert.ToInt32(Convert.ToString(Session["User_ID"])); // ViewBag.UserName = Session["UserName"]; //vm.Entity.FirstName = Convert.ToString(Session["FirstName"]); } vm.HandleRequest(); DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - HandleRequest Completed...", "Info"); return(View(vm)); } catch (Exception ex) { DBLogErrorInfo.LogErrorInfo_in_DB(ex.Message, "Error"); return(View("Error", new HandleErrorInfo(ex, "EmployeeInfo", "Create"))); } }
public ActionResult Index() { try { //if (Session["MyUserId"] == null) //{ // return RedirectToAction("Contact", "Home"); //} //DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - Home Page Loaded ...", "Info"); //UserProfileViewModel vm = new UserProfileViewModel(); //DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - View Model Created...", "Info"); //DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - HandleRequest called...", "Info"); //if (Session["MyUserId"] != null) //{ // ViewBag.MyUserId = Session["MyUserId"]; // vm.Entity.UserId = Convert.ToInt32(Convert.ToString(Session["MyUserId"])); // ViewBag.UserName = Session["UserName"]; // vm.Entity.UserName = Convert.ToString(Session["UserName"]); //} //vm.HandleRequest(); //DBLogErrorInfo.LogErrorInfo_in_DB("Inside controller - HandleRequest Completed...", "Info"); //return View(vm); return(View()); } catch (Exception ex) { DBLogErrorInfo.LogErrorInfo_in_DB(ex.Message, "Error"); return(View("Error", new HandleErrorInfo(ex, "EmployeeInfo", "Create"))); } }