public ActionResult AnswerType() { AnswerTypeMaster ansType = new AnswerTypeMaster(); ansType.LoggedInUser = long.Parse("0" + Request.Cookies["UserId"].Value); List <AnswerTypeMaster> ansTypeList = objExamBL.CRUDAnswerTypes(ansType, "L"); return(View(ansTypeList)); }
public List <SelectListItem> GetAnswerTypeListItem() { ExamBL objExamBL = new ExamBL(); List <SelectListItem> lstSelectItem = new List <SelectListItem>(); try { AnswerTypeMaster obj = new AnswerTypeMaster(); List <AnswerTypeMaster> lstUserType = objExamBL.CRUDAnswerTypes(obj, "L"); if (lstUserType != null) { lstSelectItem.Add(new SelectListItem { Text = "Select Answer Type", Value = "" }); foreach (var u in lstUserType) { lstSelectItem.Add(new SelectListItem { Text = Convert.ToString(u.AnswerType), Value = Convert.ToString(u.AnswerTypeId) }); } } } catch (Exception) { throw; } return(lstSelectItem); }