예제 #1
0
        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);
            }
        }
예제 #2
0
 public Batch GetBatch(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return db.SingleOrDefault<Batch>(Id);
     }
 }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
 public Employee GetEmployee(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return(db.SingleOrDefault <Employee>(Id));
     }
 }
예제 #5
0
 public Service GetPrintSeries(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return(db.SingleOrDefault <Service>(Id));
     }
 }
예제 #6
0
 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);
     }
 }
예제 #8
0
 public Token GetToken(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return(db.SingleOrDefault <Token>(Id));
     }
 }
예제 #9
0
 public PattiOut GetPattiOut(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return(db.SingleOrDefault <PattiOut>(Id));
     }
 }
예제 #10
0
 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);
     }
 }
예제 #12
0
 public Role GetRole(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return db.SingleOrDefault<Role>(Id);
     }
 }
예제 #13
0
 public Employee GetEmployee(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return db.SingleOrDefault<Employee>(Id);
     }
 }
예제 #14
0
 public Batch GetBatch(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return(db.SingleOrDefault <Batch>(Id));
     }
 }
예제 #15
0
 public Designation GetDesignation(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return(db.SingleOrDefault <Designation>(Id));
     }
 }
예제 #16
0
 public PattiIn GetPattiIn(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return db.SingleOrDefault<PattiIn>(Id);
     }
 }
예제 #17
0
 public Role GetRole(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return(db.SingleOrDefault <Role>(Id));
     }
 }
예제 #18
0
 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);
     }
 }
예제 #19
0
 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;
     }
 }
예제 #20
0
        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;
         }
     }
 }
예제 #22
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);
         }
     }
 }
예제 #23
0
 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;
         }
     }
 }
예제 #24
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);
         }
     }
 }
예제 #25
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);
         }
     }
 }
예제 #26
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;
         }
     }
 }
예제 #27
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;
         }
     }
 }
예제 #28
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);
         }
     }
 }
예제 #29
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;
         }
     }
 }
예제 #30
0
 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);
         }
     }
 }
예제 #31
0
 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);
         }
     }
 }
예제 #32
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;
         }
     }
 }
예제 #33
0
 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);
         }
     }
 }
예제 #34
0
 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);
         }
     }
 }
예제 #35
0
        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));
                }
            }
        }
예제 #36
0
        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);
                }
            }
        }
예제 #37
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;
         }
     }
 }
예제 #38
0
 public Service GetPrintSeries(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return db.SingleOrDefault<Service>(Id);
     }
 }
예제 #39
0
 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;
         }
     }
 }
예제 #40
0
 public Token GetToken(int Id)
 {
     using (var db = new eTempleDbDB())
     {
         return db.SingleOrDefault<Token>(Id);
     }
 }
예제 #41
0
        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;
                }
            }
        }