Example #1
0
        public JsonResult getSubAreaListByAreaID(int areaId)
        {
            // var y = convertValue("0", "Responsibility");
            IEnumerable <SubArea> list;

            using (ISubAreaRepository db = new SubAreaRepository())
            {
                list = db.getSubAreaByAreaId(areaId);
            }
            return(Json(list));
        }
Example #2
0
        private string convertValue(string value, string fieldName)
        {
            if (value == String.Empty)
            {
                return("null");
            }

            //GetWhere
            if (fieldName == "AreaID")
            {
                using (IAreaRepository db = new AreaRepository())
                {
                    return(db.Find(Int32.Parse(value)).Name);
                }
            }
            if (fieldName == "SubAreaID")
            {
                using (ISubAreaRepository db = new SubAreaRepository())
                {
                    return(db.Find(Int32.Parse(value)).Name);
                }
            }
            if (fieldName == "QuestionOwner")
            {
                using (IEmployeeRepository db = new EmployeeRepository())
                {
                    DAL.Models.Employee emp = db.Find(Int32.Parse(value));
                    return(emp.FirstName + " " + emp.LastName);
                }
            }
            if (fieldName == "RiskLevelID")
            {
                //  return EnumExtentions<RiskLevels>.GetDisplayValue(value);
                return(EnumExtentions <RiskLevels> .GetDisplayValue((RiskLevels)Int32.Parse(value)));
            }

            if (fieldName == "Responsibility")
            {
                return(Enum.GetName(typeof(Responsibility), Int32.Parse(value)));
            }

            return(value);
        }
Example #3
0
 public SubAreaController()
 {
     subAreaRepository       = new SubAreaRepository(new Exam_DBPltaform5());
     subAreaAssignRepository = new SubAreaAssignRepository(new Exam_DBPltaform5());
 }