public JsonResponse <StoreDTO> UpdateStoreProfile(long userID, int storeID, string contactPerson, string mobileNo, string emailID, string imageName, string storeAddress) { JsonResponse <StoreDTO> response = new JsonResponse <StoreDTO>(); try { ExceptionEngine.AppExceptionManager.Process(() => { StoreDTO storeDTO = new StoreDTO(); contactPerson = System.Web.HttpUtility.HtmlEncode(contactPerson); mobileNo = System.Web.HttpUtility.HtmlEncode(mobileNo); emailID = System.Web.HttpUtility.HtmlEncode(emailID); imageName = System.Web.HttpUtility.HtmlEncode(imageName); storeAddress = System.Web.HttpUtility.HtmlEncode(storeAddress); StoreBO storeBO = StoreBusinessInstance.UpdateStoreProfile(storeID, contactPerson, mobileNo, emailID, imageName, storeAddress); EntityMapper.Map(storeBO, storeDTO); if (storeDTO != null) { response.IsSuccess = true; response.Message = "Store details updated successfully"; } else { response.IsSuccess = false; response.Message = "Store details couldn't be updated"; } }, AspectEnums.ExceptionPolicyName.ServiceExceptionPolicy.ToString()); } catch (Exception ex) { response.Message = ex.Message; } return(response); }
/// <summary> /// Updates the store profile. /// </summary> /// <param name="storeID">The store identifier.</param> /// <param name="contactPerson">The contact person.</param> /// <param name="mobileNo">The mobile no.</param> /// <param name="emailID">The email identifier.</param> /// <returns></returns> public StoreBO UpdateStoreProfile(int storeID, string contactPerson, string mobileNo, string emailID, string imageName, string storeAddress) { StoreBO store = new StoreBO(); ObjectMapper.Map(StoreRepository.UpdateStoreProfile(storeID, contactPerson, mobileNo, emailID, imageName, storeAddress), store); return(store); }
public StoreBO Create(StoreBO store) { Store s = converter.Convert(store); _context.Stores.Add(s); _context.SaveChanges(); return(converter.Convert(s)); }
public StoreBO Put(int id, [FromBody] StoreBO store) { if (id == store.Id) { return(_store.Update(store)); } return(null); }
public StoreBO Update(StoreBO editedStore) { Store store = converter.Convert(editedStore); _context.Entry(store).State = Microsoft.EntityFrameworkCore.EntityState.Modified; _context.SaveChanges(); _context.SaveChanges(); return(converter.Convert(store)); }
public Store Convert(StoreBO s) { if (s == null) { return(null); } Store store = new Store { Address = s.Address, City = s.City, CoordinationX = s.CoordinationX, CoordinationY = s.CoordinationY, Id = s.Id, ItemsQuantity = s.ItemsQuantity, Locations = lc.Convert(s.Locations.ToList()), Name = s.Name, Road = s.Road, Street = s.Street }; return(store); }
public JsonResult Login(Business.Model.ModelWeb.LoginModel model) { IStore _cls = new StoreBO(); Store _store = _cls.Login(model.LoginName, model.Password); if (_store != null && _store.IsAdmin) { _session.IsLogin = true; _session.IsStore = true; _session.CustomerID = -1; _session.FullName = _store.StoreName; _session.StoreID = _store.StoreID; _session.IsAdmin = _store.IsAdmin; return Json(new { IsOk = true }, JsonRequestBehavior.AllowGet); } else { _session.IsLogin = false; _session.IsStore = false; _session.StoreID = -1; _session.IsAdmin = false; return Json(new { IsOk = false }, JsonRequestBehavior.AllowGet); } }
public JsonResult GetStore() { string jsonData = "[]"; IStore _cls = new StoreBO(); var data = _cls.GetStores(); if (data == null) data = new List<Store>(); jsonData = new JavaScriptSerializer().Serialize(data); return Json(jsonData, JsonRequestBehavior.AllowGet); }
public StoreBO Post([FromBody] StoreBO store) { return(_store.Create(store)); }