示例#1
0
        public JsonResult GetMatterForDropDown(string searchKey)
        {
            //var user = User.Identity.Name;
            //var email = LegalGuideUtility.GetStaffEmailByLoginName(user);
            //var staffId = LegalGuideUtility.GetStaffIdByEmail(email);
            var getData = db.GetAllMattersForDropDown().ToList();

            //if (HttpContext.User.IsInRole(LegalGuideUtility.ADMINISTRATOR))
            //{
            if (searchKey != null)
            {
                getData = db.GetAllMattersForDropDown().Where(x => x.Subject.Contains(searchKey)).ToList();
            }
            var ModifiedData = getData.Select(x => new
            {
                id   = x.Id,
                text = x.Subject
            });

            return(Json(ModifiedData, JsonRequestBehavior.AllowGet));
            //}
            //return null;
            //var data = null;
        }
示例#2
0
 // GET: LMSTasks/Create
 public ActionResult Create()
 {
     ViewBag.Matter   = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject");
     ViewBag.Staff    = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName");
     ViewBag.Priority = new  List <SelectListItem> {
         new SelectListItem {
             Value = "Critical", Text = "Critical"
         },
         new SelectListItem {
             Value = "High", Text = "High"
         },
         new SelectListItem {
             Value = "Medium", Text = "Medium"
         },
         new SelectListItem {
             Value = "Low", Text = "Low"
         }
     };
     return(View());
 }
示例#3
0
 // GET: FileEvents/Createad
 public ActionResult Create()
 {
     ViewBag.FileNumber = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject");
     ViewBag.StaffId    = new SelectList(db.Staffs, "StaffId", "FirstName");
     return(View());
 }
示例#4
0
 // GET: Calendars/Create
 public ActionResult Create()
 {
     ViewBag.Matter = new SelectList(db.GetAllMattersForDropDown(), "Id", "Subject");
     ViewBag.Staff  = new SelectList(db.GetAllStaffForDropDown(), "StaffId", "StaffName");
     return(View());
 }