public ActionResult Index(int?id) { try { DAViewModel daViewModel = new DAViewModel(); if (id == null) { id = (int)TempData["ModuleId"]; } daViewModel.GetDADetails((int)id); daViewModel.GetScreenAccessRights("Design Accelerator"); daViewModel.ModuleId = (int)id; TempData["ModuleId"] = daViewModel.ModuleId; int projectId; int clientId; string projectName; string appName; int applicationId; string modName; comfuns.GetModuleName((int)id, out applicationId, out modName); daViewModel.ApplicationID = applicationId; daViewModel.ModuleName = modName; comfuns.GetApplicationName(applicationId, out projectId, out appName); daViewModel.ProjectId = projectId; daViewModel.ApplicationName = appName; comfuns.GetProjectName(projectId, out clientId, out projectName); daViewModel.ClientId = clientId; daViewModel.ProjectName = projectName; daViewModel.ClientName = comfuns.GetClientName(clientId); return(View(daViewModel)); } catch (Exception ex) { errorlogviewmodel = new ErrorLogViewModel(); errorlogviewmodel.LogError(ex); return(View("Error")); } }
public ActionResult Index(DAViewModel DAViewModel) { try { if (ModelState.IsValid) { DAViewModel.DAName = DAViewModel.DAName.Trim(); DAViewModel.AddDA(DAViewModel); TempData["ModuleId"] = DAViewModel.ModuleId; return(RedirectToAction("Index", "DesignAccelerator")); } int projectId; int clientId; string projectName; string appName; int applicationId; string modName; comfuns.GetModuleName((int)DAViewModel.ModuleId, out applicationId, out modName); DAViewModel.ApplicationID = applicationId; DAViewModel.ModuleName = modName; comfuns.GetApplicationName(applicationId, out projectId, out appName); DAViewModel.ProjectId = projectId; DAViewModel.ApplicationName = appName; comfuns.GetProjectName(projectId, out clientId, out projectName); DAViewModel.ClientId = clientId; DAViewModel.ProjectName = projectName; DAViewModel.ClientName = comfuns.GetClientName(clientId); DAViewModel.GetDADetails(DAViewModel.ApplicationID); DAViewModel.GetScreenAccessRights("Design Accelerator"); return(View(DAViewModel)); } catch (Exception ex) { errorlogviewmodel = new ErrorLogViewModel(); errorlogviewmodel.LogError(ex); return(View("Error")); } }