public ActionResult Index() { int adminId = Convert.ToInt16(Session["AdminId"]); UserViewModel _model = new Models.UserViewModel(); contactServices _ser = new Database.contactServices(); _model.labels = _ser.getAllLablesByAdminid(adminId)._labelList; if (TempData["Error"] != null) { _model.Error = TempData["Error"].ToString(); } return(View(_model)); }
public ActionResult getContact(int?id) { int adminId = Convert.ToInt16(Session["AdminId"]); tblcontact _contact = new Database.tblcontact(); contactServices _ser = new Database.contactServices(); ViewData["labels"] = _ser.getAllLablesByAdminid(adminId); if (id.HasValue) { _contact = _ser.getContactsByContactid(id.Value); return(View("editcontact", _contact)); } return(View(_contact)); }