public ActionResult EditState(lmsStateMaster objStateMaster)
        {
            var saveStateDetails = _objIAdminOperations.SaveState(objStateMaster);

            //ViewBag.Message = viewMessage;
            return(RedirectToAction("ViewState", new { StateId = saveStateDetails, viewMessage = "State Details Saved Successfully" }));
        }
예제 #2
0
        public int SaveState(lmsStateMaster objStateMaster)
        {
            var resultId = 0;

            try
            {
                if (objStateMaster.STATEID > 0)
                {
                    _objLabManagementEntities.lmsStateMasters.Attach(objStateMaster);
                    _objLabManagementEntities.Entry(objStateMaster).State = EntityState.Modified;
                    _objLabManagementEntities.SaveChanges();
                    return(objStateMaster.STATEID);
                }
                _objLabManagementEntities.lmsStateMasters.Add(objStateMaster);
                _objLabManagementEntities.SaveChanges();
                resultId = _objLabManagementEntities.lmsStateMasters.LastOrDefault().STATEID;
            }
            catch (Exception ex)
            {
                _objIAppLogger.LogError(ex);
            }
            return(resultId);
        }