private bool saveData()
 {
     try
     {
         LookupModel model = assignModel();
         if (model != null)
         {
             if (this.pId.HasValue)
             {
                 return(service.Update(LookUp.TPLab, model));
             }
             else
             {
                 return(service.Create(LookUp.TPLab, model));
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         Utility.ErrorLog.Logging("Department Operations", ex.Message.ToString(), ex.StackTrace.ToString());
         return(false);
     }
 }
        public ActionResult Create(Lookup lookup, string userName)
        {
            //Lookup lookup = null;
            UpdateModel(lookup);
            lookup = serv.Create(lookup, userName);
            var result = map.Map <Domain.Lookup, ViewModel.Lookup>(lookup);

            return(Json(new
            {
                sNewRef = result.tabref,
                sNewLabel = result.tablabel,
                iNewID = result.ID,
                jobSuccess = true
            }));
        }
Example #3
0
 public async Task <ActionResult> Create(Lookup lookup, string userName)
 {
     //Lookup lookup = null;
     if (await TryUpdateModelAsync(lookup))
     {
         lookup = serv.Create(lookup, userName);
         var result = map.Map <Lookup, ViewModel.Lookup>(lookup);
         return(Json(new
         {
             sNewRef = result.tabref,
             sNewLabel = result.tablabel,
             iNewID = result.ID,
             jobSuccess = true
         }));
     }
     else
     {
         return(Json(new { jobSuccess = false }));
     }
 }
Example #4
0
 public FluentRecordBase AddLookup(
     DateTime?datecreated = null,
     DateTime?dateupdated = null
     )
 {
     //
     // DEPENDENCIES
     _servL = container.Resolve <ILookupService>();
     //
     // ARRANGE
     _l = (Lookup)Records.lookup.Clone();
     if (datecreated != null)
     {
         _l.datecreated = (DateTime)datecreated;
     }
     if (dateupdated != null)
     {
         _l.dateupdated = (DateTime)dateupdated;
     }
     //
     // ACT
     _servL.Create(_l, _user);
     return(this);
 }