public Donors checkModifyDonorIDExists(string chkId) { var donors = TempleDb.SingleOrDefault <Donors>("Select * from Donors where Id=@0", chkId); if (donors != null && donors.Id != null) { return(donors); } else { return(null); } }
public Batch GetBatch(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<Batch>(Id); } }
public double GEtTotalCostByTransactionType(DateTime fromDate, DateTime toDate, String tType) { var startDate = new DateTime(fromDate.Year, fromDate.Month, fromDate.Day); var endDate = new DateTime(toDate.Year, toDate.Month, toDate.Day); if (startDate == endDate) { endDate.AddDays(1); } String strDt = String.Format("{0:yyyy-MM-dd}", startDate); String toDt = String.Format("{0:yyyy-MM-dd}", endDate); using (var db = new eTempleDbDB()) { String SqlQuery = "Select sum(TotalCost) as TotalCost from Tokens where ( CreatedOn between '" + strDt + "' and '" + toDt + "' ) and TransactionType = '" + tType + "' "; var tokenObj = db.SingleOrDefault <Token>(SqlQuery); if (tokenObj != null && tokenObj.TotalCost != null) { return((double)tokenObj.TotalCost); } else { return(0); } } }
public Employee GetEmployee(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <Employee>(Id)); } }
public Service GetPrintSeries(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <Service>(Id)); } }
public StockDetail GetStockDetail(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <StockDetail>(Id)); } }
public StockDetail GetStockDetail(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<StockDetail>(Id); } }
public Token GetToken(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <Token>(Id)); } }
public PattiOut GetPattiOut(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <PattiOut>(Id)); } }
public Designation GetDesignation(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<Designation>(Id); } }
public ServiceType GetServiceType(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<ServiceType>(Id); } }
public Role GetRole(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<Role>(Id); } }
public Employee GetEmployee(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<Employee>(Id); } }
public Batch GetBatch(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <Batch>(Id)); } }
public Designation GetDesignation(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <Designation>(Id)); } }
public PattiIn GetPattiIn(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<PattiIn>(Id); } }
public Role GetRole(int Id) { using (var db = new eTempleDbDB()) { return(db.SingleOrDefault <Role>(Id)); } }
public int GetLastBatchByService(int serviceId) { using (var db = new eTempleDbDB()) { var batchObj = db.SingleOrDefault <Batch>("where ServiceId=@0 order by Id desc LIMIT 0, 1", serviceId); return(batchObj.Id); } }
public int GetLastBatchByService(int serviceId) { using (var db = new eTempleDbDB()) { var batchObj = db.SingleOrDefault<Batch>("where ServiceId=@0 order by Id desc LIMIT 0, 1", serviceId); return batchObj.Id; } }
public Gothrams checkIfGothramExists(string chkGothramExists) { var gothrams = TempleDb.SingleOrDefault <Gothrams>("Select * from gothrams where Name=@0", chkGothramExists); if (gothrams != null && gothrams.Name != null) { return(gothrams); } else { return(null); } }
public int getStockByServiceId(int serviceId) { using (var db = new eTempleDbDB()) { var sdObj = db.SingleOrDefault<StockDetail>("select * from StockDetails where ServiceId=@0", serviceId); if (sdObj != null && sdObj.Stock!= null) { return (int)sdObj.Stock; } else { return 0; } } }
public int GetDailyBatchByService(int serviceId, String cdtval) { using (var db = new eTempleDbDB()) { var batchObj = db.SingleOrDefault <Batch>("where ServiceId=@0 and date(CreatedOn) like '@1' order by Id desc LIMIT 0, 1", serviceId, cdtval); if (batchObj != null && batchObj.DailyBatchId != 0) { return(batchObj.DailyBatchId + 1); } else { return(1); } } }
public Employee ValidateLogin(string loginId, string password) { using (var db = new eTempleDbDB()) { var emp = db.SingleOrDefault<Employee>("Select * from Employees where LoginId=@0 and Password=@1", loginId, password); if (emp != null && emp.Name!= null) { return emp; } else { return null; } } }
public long GetLastBatchDailyNumberByService(int serviceId) { using (var db = new eTempleDbDB()) { var batchObj = db.SingleOrDefault <Batch>("where ServiceId=@0 order by Id desc LIMIT 0, 1", serviceId); if (batchObj != null && batchObj.LastDailyNumber != null) { return(batchObj.LastDailyNumber); } else { return(0); } } }
public int GetHundials() { using (var db = new eTempleDbDB()) { var serviceObj = db.SingleOrDefault <Service>("Select * From Services where Type in(13) order by Id desc LIMIT 0, 1"); if (serviceObj != null && serviceObj.Id != null) { return((int)serviceObj.Id); } else { return(0); } } }
public long GetLastBatchDailyNumberByService(int serviceId) { using (var db = new eTempleDbDB()) { var batchObj = db.SingleOrDefault<Batch>("where ServiceId=@0 order by Id desc LIMIT 0, 1", serviceId); if (batchObj != null && batchObj.LastDailyNumber != null) { return batchObj.LastDailyNumber; } else { return 0; } } }
public long getLeastDailyNumber(int serviceId) { using (var db = new eTempleDbDB()) { var tokenObj = db.SingleOrDefault<Token>("select min(ServiceDailyNumber) as ServiceDailyNumber from Tokens where ServiceId=@0", serviceId); if (tokenObj != null && tokenObj.ServiceDailyNumber != null) { return (long)tokenObj.ServiceDailyNumber; } else { return 0; } } }
public int getStockByServiceId(int serviceId) { using (var db = new eTempleDbDB()) { var sdObj = db.SingleOrDefault <StockDetail>("select * from StockDetails where ServiceId=@0", serviceId); if (sdObj != null && sdObj.Stock != null) { return((int)sdObj.Stock); } else { return(0); } } }
public int GetDailyBatchByService(int serviceId, String cdtval) { using (var db = new eTempleDbDB()) { var batchObj = db.SingleOrDefault<Batch>("where ServiceId=@0 and date(CreatedOn) like '@1' order by Id desc LIMIT 0, 1", serviceId, cdtval); if (batchObj != null && batchObj.DailyBatchId != 0) { return (batchObj.DailyBatchId + 1); } else { return 1; } } }
public Employees ValidateLogin(string loginId, string password) { using (var db = new eTempleDbDB()) { var emp = db.SingleOrDefault <Employees>("Select * from Employees where LoginId=@0 and Password=@1", loginId, password); if (emp != null && emp.Name != null) { return(emp); } else { return(null); } } }
public long getHighestDailyNumber(int serviceId) { using (var db = new eTempleDbDB()) { var tokenObj = db.SingleOrDefault <Token>("select max(ServiceDailyNumber) as ServiceDailyNumber from Tokens where ServiceId=@0", serviceId); if (tokenObj != null && tokenObj.ServiceDailyNumber != null) { return((long)tokenObj.ServiceDailyNumber); } else { return(0); } } }
public long getMinGovtNumber(int uId) { using (var db = new eTempleDbDB()) { var PrintSeriesObj = db.SingleOrDefault<PrintSeries>("select PrintseriesStart from PrintSeries where GivenTo = '@0' order by Id desc LIMIT 0, 1", uId); if (PrintSeriesObj != null && PrintSeriesObj.PrintseriesStart != null) { return (long)PrintSeriesObj.PrintseriesStart; } else { long gId = 0; return gId; } } }
public long getMaxGovtNumber(int uId) { using (var db = new eTempleDbDB()) { var PrintSeriesObj = db.SingleOrDefault <PrintSeries>("select PrintseriesEnd from PrintSeries where GivenTo = '@0' order by Id desc LIMIT 0, 1", uId); if (PrintSeriesObj != null && PrintSeriesObj.PrintseriesEnd != null) { return((long)PrintSeriesObj.PrintseriesEnd); } else { long gId = 0; return(gId); } } }
public long getMaxDailyNumber(DateTime dt1) { String dt = String.Format("{0:yyyy-MM-dd}", dt1); using (var db = new eTempleDbDB()) { var tokenObj = db.SingleOrDefault<Token>("select max(DailyNumber) as DailyNumber from Tokens where DATE(CreatedOn) like '" + dt + "' order by Id desc LIMIT 0, 1"); if (tokenObj != null && tokenObj.DailyNumber != null) { return (long)tokenObj.DailyNumber; } else { String str = string.Format("{0:yyyyMMdd}0000", DateTime.Now); return Convert.ToInt64(str); } } }
public long getMaxDailyNumber(DateTime dt1) { String dt = String.Format("{0:yyyy-MM-dd}", dt1); using (var db = new eTempleDbDB()) { var tokenObj = db.SingleOrDefault <Token>("select max(DailyNumber) as DailyNumber from Tokens where DATE(CreatedOn) like '" + dt + "' order by Id desc LIMIT 0, 1"); if (tokenObj != null && tokenObj.DailyNumber != null) { return((long)tokenObj.DailyNumber); } else { String str = string.Format("{0:yyyyMMdd}0000", DateTime.Now); return(Convert.ToInt64(str)); } } }
public int GetTimeIdCount(int TimeIdVal, int serviceId) { String dt = String.Format("{0:yyyy-MM-dd}", DateTime.Now); using (var db = new eTempleDbDB()) { String SqlQuery = "Select sum(Quantity) as Quantity from Tokens where TimeId = " + TimeIdVal + " and Date(ServicePerformDate) = '" + dt + "' and ServiceId='" + serviceId + "' "; var tokenObj = db.SingleOrDefault <Token>(SqlQuery); if (tokenObj != null && tokenObj.Quantity != null) { return((int)tokenObj.Quantity); } else { return(0); } } }
public int GetMiscIncomes() { using (var db = new eTempleDbDB()) { var serviceObj = db.SingleOrDefault<Service>("Select * From Services where Type in(14) order by Id desc LIMIT 0, 1"); if (serviceObj != null && serviceObj.Id != null) { return (int)serviceObj.Id; } else { return 0; } } }
public Service GetPrintSeries(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<Service>(Id); } }
public int GetTimeIdCount(int TimeIdVal, int serviceId) { String dt = String.Format("{0:yyyy-MM-dd}", DateTime.Now); using (var db = new eTempleDbDB()) { String SqlQuery = "Select sum(Quantity) as Quantity from Tokens where TimeId = " + TimeIdVal + " and Date(ServicePerformDate) = '" + dt + "' and ServiceId='" + serviceId + "' "; var tokenObj = db.SingleOrDefault<Token>(SqlQuery); if (tokenObj != null && tokenObj.Quantity != null) { return (int)tokenObj.Quantity; } else { return 0; } } }
public Token GetToken(int Id) { using (var db = new eTempleDbDB()) { return db.SingleOrDefault<Token>(Id); } }
public double GEtTotalCostByTransactionType(DateTime fromDate, DateTime toDate, String tType) { var startDate = new DateTime(fromDate.Year, fromDate.Month, fromDate.Day); var endDate = new DateTime(toDate.Year, toDate.Month, toDate.Day); if (startDate == endDate) endDate.AddDays(1); String strDt = String.Format("{0:yyyy-MM-dd}", startDate); String toDt = String.Format("{0:yyyy-MM-dd}", endDate); using (var db = new eTempleDbDB()) { String SqlQuery = "Select sum(TotalCost) as TotalCost from Tokens where ( CreatedOn between '" + strDt + "' and '" + toDt + "' ) and TransactionType = '" + tType + "' "; var tokenObj = db.SingleOrDefault<Token>(SqlQuery); if (tokenObj != null && tokenObj.TotalCost != null) { return (double)tokenObj.TotalCost; } else { return 0; } } }