public StoreDTO CreateStore(StoreDTO store) { var userId = _userbusiness.GetByName(store.UserName).Result.ID; store.CreatedDate = System.DateTime.Now; store.ModifiedDate = System.DateTime.Now; store.StatusID = WAITINGFORAPPROVE; store.UserID = userId; store.CityId = _city.GetByName(store.City).Id; store.CountryId = _country.GetByName(store.Country).Id; var DisString = store.District.Split('.'); if (DisString.Length > 1) { store.DistrictId = _district.GetByName(DisString[1]).Id; } else if (DisString.Length == 1) { store.DistrictId = _district.GetByName(DisString[0]).Id; } store.ModifiedByID = userId; store.LimitProduct = PACKAGE1; store = _repo.Create(BusinessTranslators.ToStoreEntity(store)).Translate <Store, StoreDTO>(); return(store); }
public bool IsApplied(int storeId, string username) { var userId = _user.GetByName(username).Result.ID; return(_repo.IsApplied(userId, storeId)); }