public JsonResult AddLookUpValue(LookupModel model)
        {
            model.Section = "ASM";
            var result = _lookupModel.Create(model);
            IEnumerable<AssignmentLookup> lookupData = new List<AssignmentLookup>();

            if (!result) return Json(new {data = lookupData, IsSuccess = false});
            switch (model.Type)
            {
                case  "Requestor Name":
                    lookupData = _assignmentLookup.RequestorName;
                    break;
                default:
                    lookupData = new List<AssignmentLookup>();
                    break;
            }
            return Json(new {data = lookupData,IsSuccess =true});
        }
        public JsonResult AddLookUpValue(LookupModel model)
        {
            model.Section = "ASM";
            bool result;
            if (model.Transaction.Equals("Delete"))
            {
                result = _lookupModel.Update(model);
            }
            else
            {
                result = _lookupModel.Create(model);
            }
            IEnumerable<AssignmentLookup> lookupData = new List<AssignmentLookup>();

            if (!result) return Json(new { data = lookupData, IsSuccess = false });
            switch (model.Type)
            {
                case "Requestor Name":
                    lookupData = _assignmentLookup.RequestorName;
                    break;
                case "Request Type":
                    lookupData = _assignmentLookup.RequestType;
                    break;
                case "Request Reason":
                    lookupData = _assignmentLookup.RequestReason;
                    break;
                case "Doc Type":
                    lookupData = _assignmentLookup.DocumentType;
                    break;
                case "Status":
                    lookupData = _assignmentLookup.Status;
                    break;
                case "Assigned To":
                    lookupData = _assignmentLookup.AssignedTo;
                    break;
                default:
                    lookupData = new List<AssignmentLookup>();
                    break;
            }
            return Json(new { data = lookupData, IsSuccess = true });
        }
Esempio n. 3
0
 public bool Create(LookupModel model)
 {
     return _apiInstance.Insert(model, Constants.ADDLOOKUP);
 }
Esempio n. 4
0
 public bool Update(LookupModel model)
 {
     return _apiInstance.Update(model, Constants.DELETELOOKUP);
 }