public PartialViewResult ConfigureRoles() { TeamMgmtModel objTeamMgmtModel = new TeamMgmtModel(); objTeamMgmtModel.ObjTeamMgmtDBEntities = objTeamMgmtDBEntities; objTeamMgmtModel.RolesSelectList = new SelectList(objTeamMgmtDBEntities.LkpRoles, "Id", "RoleName"); return PartialView("/Views/PartialViews/Partial_ConfigureRoles.cshtml", objTeamMgmtModel); }
public ViewResult Index() { //Create a new collecction of objects to be displayed var obj = new Dictionary<int, string>(); obj[1]="Hariom"; obj[2]="Kuntal"; obj[3]="Singh"; ViewBag.HasPermission = true; //ViewData["hasPermission"] = true; ViewData["CurrentTime"] = DateTime.Now.ToString(); //Populate the Model object WorkCaptureModel objWorkCaptureModel = new WorkCaptureModel(); objWorkCaptureModel.SelectNameItem = new SelectListItem(); objWorkCaptureModel.SelectNameItem.Text = "HariomText"; objWorkCaptureModel.SelectNameItem.Value = "HariomValue"; //Create the list to be populated Dictionary<string,string> objCountry = new Dictionary<string,string>(); objCountry.Add("I","India"); objCountry.Add("N","Nepal"); objCountry.Add("S","SriLanka"); //objWorkCaptureModel.SelectNamesList = new SelectList(objCountry.Values); TeamMgmtModel objTeamMgmtModel = new TeamMgmtModel(); objWorkCaptureModel.SelectNamesList = new SelectList(objTeamMgmtModel.RolesSelectList,"EmpName","EmpId"); //return View(obj); return View(objWorkCaptureModel); }