public Data.Models.AccountBankDetail GetBankDataById(int accountId) { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { return(db.AccountBankDetails.FirstOrDefault(w => w.Id == accountId)); } } catch (Exception) { throw; } }
public Data.Models.TaxableRate[] GetTaxableRate() { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { return(db.TaxableRates.OrderBy(o => o.TaxableRate1).ToArray()); } } catch { throw; } }
public List <Data.Models.AccountBankDetail> GetAccountBankList(int accountId) { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { return(db.AccountBankDetails.Where(w => w.AccountId == accountId).OrderBy(o => o.BankName).ToList()); } } catch (Exception) { throw; } }
public Data.Models.User GetUserName(string UserName) { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { return(db.Users.FirstOrDefault(w => w.UserName == UserName)); } } catch (SqlException) { return(null); } }
public Data.Models.City[] GetCityList(int stateId) { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { return(db.Cities.Where(w => w.StateId == stateId).OrderBy(o => o.CityName).ToArray()); } } catch { throw; } }
public Data.Models.State GetStateById(int Id) { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { return(db.States.FirstOrDefault(o => o.Id == Id)); } } catch { throw; } }
public Data.Models.State[] GetStateList() { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { return(db.States.OrderBy(o => o.StateName).ToArray()); } } catch { throw; } }
public Array GetData(string Qry, string tblName) { try { using (Data.Models.GSTinvoiceContext db = new Data.Models.GSTinvoiceContext()) { if (tblName == "Account") { return(db.Database.SqlQuery <AccountResultModel>(Qry).ToArray()); } else if (tblName == "Client") { return(db.Database.SqlQuery <ClientResultModel>(Qry).ToArray()); } else if (tblName == "Item") { return(db.Database.SqlQuery <ItemResultModel>(Qry).ToArray()); } else if (tblName == "Invoice") { return(db.Database.SqlQuery <InvoiceModel>(Qry).ToArray()); } else if (tblName == "InvoiceTransactions") { return(db.Database.SqlQuery <InvoiceDataModel>(Qry).ToArray()); } else { return(null); } } } catch (SqlException) { return(null); } }