public async Task <List <TxnCustomer> > GetAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.TxnCustomer.ToListAsync()); } }
public async Task <TxnCustomer> GetAsync(int id) { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.TxnCustomer.Where(x => x.CustomerId == id).FirstOrDefaultAsync()); } }
public async Task <List <VItemProvider> > GetAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.VItemProvider.ToListAsync()); } }
public async Task <MstEkaiType> GetAsync(int id) { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.MstEkaiType.Where(x => x.EkaiTypeId == id).FirstOrDefaultAsync()); } }
public async Task <List <TxnVolunteerBankDetails> > GetAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.TxnVolunteerBankDetails.ToListAsync()); } }
public async Task <TxnVolunteerBankDetails> GetAsync(int id) { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.TxnVolunteerBankDetails.Where(x => x.VolunteerBankDetailsId == id).FirstOrDefaultAsync()); } }
public async Task <List <VItemFormula> > GetAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.VItemFormula.ToListAsync()); } }
public async Task <List <VItems> > GetViewAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.VItems.ToListAsync()); } }
public async Task <TxnItemFormula> GetAsync(int id) { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.TxnItemFormula.Where(x => x.ItemFormulaId == id).FirstOrDefaultAsync()); } }
public async Task <List <VCustomerOrderWithDetails> > GetAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.VCustomerOrderWithDetails.ToListAsync()); } }
public async Task <MstDistricts> GetAsync(string code) { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.MstDistricts.Where(x => x.DistrictCode == code).FirstOrDefaultAsync()); } }
public async Task <List <VDistricts> > GetAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.VDistricts.ToListAsync()); } }
public async Task <MstItems> GetAsync(int id) { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.MstItems.Where(x => x.ItemId == id).FirstOrDefaultAsync()); } }
public async Task <List <MstEkaiType> > GetAsync() { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.MstEkaiType.ToListAsync()); } }
public async Task <List <MstDistricts> > GetDistrictByStateCodeAsync(string stateCode) { using (EkalContext dbContext = new EkalContext()) { return(await dbContext.MstDistricts.Where(x => x.StateCode == stateCode) .OrderBy(y => y.DistrictName) .ToListAsync()); } }
public async Task <bool> AddRangeAsync(List <TxnItemFormulaDetails> entities) { using (EkalContext dbContext = new EkalContext()) { try { await dbContext.TxnItemFormulaDetails.AddRangeAsync(entities); dbContext.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.ToString()); } } }
public async Task <bool> AddAsync(TxnCustomerDeliveryAddress entity) { using (EkalContext dbContext = new EkalContext()) { try { await dbContext.TxnCustomerDeliveryAddress.AddAsync(entity); dbContext.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.ToString()); } } }
public async Task <bool> AddAsync(MstVolunteerType entity) { using (EkalContext dbContext = new EkalContext()) { try { await dbContext.MstVolunteerType.AddAsync(entity); dbContext.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.ToString()); } } }
public async Task <bool> AddAsync(TxnItemFormula entity) { using (EkalContext dbContext = new EkalContext()) { try { await dbContext.TxnItemFormula.AddAsync(entity); dbContext.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.ToString()); } } }
public async Task <bool> DeleteAsync(int id) { using (EkalContext dbContext = new EkalContext()) { try { var tmpRecord = await dbContext.TxnItemFormula.Where(x => x.ItemFormulaId == id).FirstOrDefaultAsync(); dbContext.TxnItemFormula.Remove(tmpRecord); dbContext.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.ToString()); } } }
public async Task <bool> DeleteAsync(string code) { using (EkalContext dbContext = new EkalContext()) { try { var tmpRecord = await dbContext.MstDistricts.Where(x => x.DistrictCode == code).FirstOrDefaultAsync(); dbContext.MstDistricts.Remove(tmpRecord); dbContext.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.ToString()); } } }
public async Task <string> GetNextOrderNoAsync() { using (EkalContext dbContext = new EkalContext()) { string OrderNoPrefix = "O"; var totalOrders = await dbContext.TxnCustomerOrder.CountAsync(); if (totalOrders == 0) { OrderNoPrefix = "O001"; } else { OrderNoPrefix = "O" + (totalOrders + 1).ToString().PadLeft(3, '0'); } return(OrderNoPrefix); } }
public async Task <bool> AddAsync(TxnCustomer entity) { using (EkalContext dbContext = new EkalContext()) { try { entity.CreatedDate = DateTime.Now; entity.CreatedBy = Common.UserProfileID; await dbContext.TxnCustomer.AddAsync(entity); dbContext.SaveChanges(); return(true); } catch (Exception ex) { throw new Exception(ex.ToString()); } } }