public Store_BusinessConcentrationLevelDTO(BusinessConcentrationLevel BusinessConcentrationLevel) { this.Id = BusinessConcentrationLevel.Id; this.Name = BusinessConcentrationLevel.Name; this.Manufacturer = BusinessConcentrationLevel.Manufacturer; this.Branch = BusinessConcentrationLevel.Branch; this.RevenueInYear = BusinessConcentrationLevel.RevenueInYear; this.MarketingStaff = BusinessConcentrationLevel.MarketingStaff; this.StoreId = BusinessConcentrationLevel.StoreId; }
public async Task <BusinessConcentrationLevel> Get(long Id) { BusinessConcentrationLevel BusinessConcentrationLevel = await DataContext.BusinessConcentrationLevel.AsNoTracking() .Where(x => x.Id == Id) .Select(x => new BusinessConcentrationLevel() { Id = x.Id, Name = x.Name, Manufacturer = x.Manufacturer, Branch = x.Branch, RevenueInYear = x.RevenueInYear, MarketingStaff = x.MarketingStaff, StoreId = x.StoreId, Store = x.Store == null ? null : new Store { Id = x.Store.Id, Code = x.Store.Code, CodeDraft = x.Store.CodeDraft, Name = x.Store.Name, UnsignName = x.Store.UnsignName, ParentStoreId = x.Store.ParentStoreId, OrganizationId = x.Store.OrganizationId, StoreTypeId = x.Store.StoreTypeId, StoreGroupingId = x.Store.StoreGroupingId, Telephone = x.Store.Telephone, ProvinceId = x.Store.ProvinceId, DistrictId = x.Store.DistrictId, WardId = x.Store.WardId, Address = x.Store.Address, UnsignAddress = x.Store.UnsignAddress, DeliveryAddress = x.Store.DeliveryAddress, Latitude = x.Store.Latitude, Longitude = x.Store.Longitude, DeliveryLatitude = x.Store.DeliveryLatitude, DeliveryLongitude = x.Store.DeliveryLongitude, OwnerName = x.Store.OwnerName, OwnerPhone = x.Store.OwnerPhone, OwnerEmail = x.Store.OwnerEmail, TaxCode = x.Store.TaxCode, LegalEntity = x.Store.LegalEntity, AppUserId = x.Store.AppUserId, StatusId = x.Store.StatusId, RowId = x.Store.RowId, Used = x.Store.Used, StoreStatusId = x.Store.StoreStatusId, }, }).FirstOrDefaultAsync(); if (BusinessConcentrationLevel == null) { return(null); } return(BusinessConcentrationLevel); }
public async Task <bool> Create(BusinessConcentrationLevel BusinessConcentrationLevel) { BusinessConcentrationLevelDAO BusinessConcentrationLevelDAO = new BusinessConcentrationLevelDAO(); BusinessConcentrationLevelDAO.Id = BusinessConcentrationLevel.Id; BusinessConcentrationLevelDAO.Name = BusinessConcentrationLevel.Name; BusinessConcentrationLevelDAO.Manufacturer = BusinessConcentrationLevel.Manufacturer; BusinessConcentrationLevelDAO.Branch = BusinessConcentrationLevel.Branch; BusinessConcentrationLevelDAO.RevenueInYear = BusinessConcentrationLevel.RevenueInYear; BusinessConcentrationLevelDAO.MarketingStaff = BusinessConcentrationLevel.MarketingStaff; BusinessConcentrationLevelDAO.StoreId = BusinessConcentrationLevel.StoreId; DataContext.BusinessConcentrationLevel.Add(BusinessConcentrationLevelDAO); await DataContext.SaveChangesAsync(); BusinessConcentrationLevel.Id = BusinessConcentrationLevelDAO.Id; await SaveReference(BusinessConcentrationLevel); return(true); }
public async Task <bool> Update(BusinessConcentrationLevel BusinessConcentrationLevel) { BusinessConcentrationLevelDAO BusinessConcentrationLevelDAO = DataContext.BusinessConcentrationLevel.Where(x => x.Id == BusinessConcentrationLevel.Id).FirstOrDefault(); if (BusinessConcentrationLevelDAO == null) { return(false); } BusinessConcentrationLevelDAO.Id = BusinessConcentrationLevel.Id; BusinessConcentrationLevelDAO.Name = BusinessConcentrationLevel.Name; BusinessConcentrationLevelDAO.Manufacturer = BusinessConcentrationLevel.Manufacturer; BusinessConcentrationLevelDAO.Branch = BusinessConcentrationLevel.Branch; BusinessConcentrationLevelDAO.RevenueInYear = BusinessConcentrationLevel.RevenueInYear; BusinessConcentrationLevelDAO.MarketingStaff = BusinessConcentrationLevel.MarketingStaff; BusinessConcentrationLevelDAO.StoreId = BusinessConcentrationLevel.StoreId; await DataContext.SaveChangesAsync(); await SaveReference(BusinessConcentrationLevel); return(true); }
private async Task SaveReference(BusinessConcentrationLevel BusinessConcentrationLevel) { }
public async Task <bool> Delete(BusinessConcentrationLevel BusinessConcentrationLevel) { await DataContext.BusinessConcentrationLevel.Where(x => x.Id == BusinessConcentrationLevel.Id).DeleteFromQueryAsync(); return(true); }