Exemple #1
0
 public string GetCertifiedBy()
 {
     return(SQLTools.ExecuteSingleResult($@"
                 select concat(ln,', ',fn,' ',mn) as certby from period
                 left join attendance on attendance.pid=period.pid
                 left join dutydetails on dutydetails.DID= attendance.DID
                 left join certifier on period.certby = certifier.ccid where month='{period.month}' and period = '{period.period}' and year='{period.year}' and aid='{AID}'"));
 }
Exemple #2
0
        public static string[] GetAttendanceTooltip(int aid, int period, int month, int year)
        {
            string hpblob =
                SQLTools.ExecuteSingleResult(
                    $@"SELECT hp FROM msadbarchive.period where gid={aid} and period={period} and month = {
                            month
                        } and year={year};");
            HourProcessor h = (HourProcessor)Payroll._DeserializeObject(hpblob);

            string[] a = new string[24];
            string[] b =
            {
                #region +Keys
                "nsu_proper_day_normal",
                "nsu_overtime_day_normal",
                "sun_proper_day_normal",
                "sun_overtime_day_normal",
                "nsu_proper_night_normal",
                "nsu_overtime_night_normal",
                "sun_proper_night_normal",
                "sun_overtime_night_normal",
                "nsu_proper_day_regular",
                "nsu_overtime_day_regular",
                "sun_proper_day_regular",
                "sun_overtime_day_regular",
                "nsu_proper_day_special",
                "nsu_overtime_day_special",
                "sun_proper_day_special",
                "sun_overtime_day_special",
                "nsu_proper_night_regular",
                "nsu_overtime_night_regular",
                "sun_proper_night_regular",
                "sun_overtime_night_regular",
                "nsu_proper_night_special",
                "nsu_overtime_night_special",
                "sun_proper_night_special",
                "sun_overtime_night_special"
                #endregion
            };

            for (int c = 0; c < b.Length; c++)
            {
                TimeSpan ts = h.hp[b[c]];
                a[c] = (b[c][4] == 'p' ? "Regular" : "Overtime") + ": " + (((int)(ts.TotalHours)).ToString("00") + ":" + ((int)ts.Minutes).ToString("00")).ToString() + " hrs.";
            }
            return(a);
        }
Exemple #3
0
 public static int GetInt(String query)
 {
     return(int.Parse(SQLTools.ExecuteSingleResult(query)));
 }
Exemple #4
0
        public static String GetNumberOfClientRequests(int RequestStatusEnumeration)
        {
            String q = "select count(*) from request where rstatus=" + RequestStatusEnumeration;

            return(SQLTools.ExecuteSingleResult(q));
        }
Exemple #5
0
        public static int GetNumberOfUnassignedGuards()
        {
            int ass = int.Parse(SQLTools.ExecuteSingleResult("select count(*) from guards"));

            return(ass - GetNumberOfAssignedGuards());
        }
Exemple #6
0
 public static int GetNumberOfAssignedGuards()
 {
     return(int.Parse(SQLTools.ExecuteSingleResult("select count(*) from sduty_assignment where astatus=1;")));
 }
Exemple #7
0
 public static int GetNumberOfTotalClients()
 {
     return(int.Parse(SQLTools.ExecuteSingleResult("SELECT count(*) FROM client;")));
 }
Exemple #8
0
 public static int GetNumberOfActiveClients()
 {
     return(int.Parse(SQLTools.ExecuteSingleResult($@"SELECT count(*) FROM client WHERE cstatus = {Enumeration.ClientStatus.Active};")));
 }