Esempio n. 1
0
        public static void AddCertifier(int cid, string fn, string mn, string ln, string contactno)
        {
            var q =
                $@"INSERT INTO `msadb`.`certifier` (`cid`, `fn`, `ln`, `mn`,`contactno`) VALUES ('{cid}', '{fn}', '{ln}', '{mn}', '{contactno}');";

            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 2
0
        public static DataTable GetAllAssignmentDetails(int AID)
        {
            SQLTools.ExecuteNonQuery("call msadb.init_checkdate_assignmentstatus();");

            /*
             * On Status:  What status? Assignment status?
             * NTS: Is status supposed to be active when guard has duty? Or when guard has assignment?
             */
            //return Gid, Name sa Guard, CID, name sa client, status
            String q = @"/* return Gid, Name sa Guard, CID, name sa client, status */
                            select 
                            guards.gid as gid,
                            client.cid as cid,
                            concat(ln,', ',fn,' ',mn) as guardname,
                            client.name as clientname,
                            case astatus when 1 then 'Active' when 2 then 'Inactive' end as assignmentstatus
                             from sduty_assignment
                            left join request_assign on sduty_assignment.RAID=request_assign.RAID
                            left join request on request.RID = request_assign.RID
                            left join client on request.cid = client.cid
                            left join guards on guards.gid = sduty_assignment.GID
                            where sduty_assignment.AID = " + AID;

            return(SQLTools.ExecuteQuery(q));
        }
Esempio n. 3
0
        public static void UpdateDutyDetailDates(int did, DateTime de, DateTime dd)
        {
            var q = $@"UPDATE `msadb`.`dutydetails` SET `date_effective`='{de:yyyy-MM-dd}', `date_dismissal`='{dd:yyyy-MM-dd}' WHERE `DID`='{did}';";

            SQLTools.ExecuteNonQuery(q);
            SQLTools.ExecuteNonQuery("call init_checkdate_dutydetail();");
        }
Esempio n. 4
0
        public static string AddDutyDetail(int aid, String TI_hr, String TI_min, String TI_ampm, String TO_hr, String TO_min, String TO_ampm, Days days, DateTime DateEffective, DateTime DateDismissed)
        {
            bool isOverlap = HasOverlap(aid, ($@"{TI_hr}:{TI_min}"), ($@"{TO_hr}:{TO_min}"), days, DateEffective, DateDismissed);

            if (isOverlap)
            {
                return(">");
            }
            DateTime      ti       = DateTime.Parse($"3/1/0001 {TI_hr}:{TI_min} {TI_ampm}");
            DateTime      to       = DateTime.Parse($"3/1/0001 {TO_hr}:{TO_min} {TO_ampm}");
            HourProcessor hp       = new HourProcessor(ti, to, ti, to);
            DateTime      to_props = ti.AddHours(8);
            TimeSpan      e        = hp.GetTotalTS();
            String        q        = $@"
                        INSERT INTO `msadb`.`dutydetails` 
                        (`AID`, 
                        `TI_hh`, `TI_mm`, `TI_period`, 
                        `TO_hh`, `TO_mm`, `TO_period`,
                        `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`, 
                        `DStatus`, `minutediff`,`to_actual_hh`,`to_actual_mm`,`to_actual_period`, `date_effective`, `date_dismissal`) 
                        VALUES 
                        ('{aid}',
                        '{TI_hr}','{TI_min}','{TI_ampm}',
                        '{to_props:hh}','{to_props:mm}','{to_props:tt}',
                        '{ToInt32(days.Mon)}','{ToInt32(days.Tue)}','{ToInt32(days.Wed)}','{ToInt32(days.Thu)}','{ToInt32(days.Fri)}',
                        '{ToInt32(days.Sat)}','{ToInt32(days.Sun)}',
                        '{Enumeration.DutyDetailStatus.Pending}', {(int)e.TotalMinutes},
                        '{TO_hr}','{TO_min}','{TO_ampm}', '{DateEffective:yyyy-MM-dd}', '{DateDismissed:yyyy-MM-dd}');
                        ";

            //if (e.TotalHours > 8) { return "="; } else if (e.TotalHours < 8) { return "="; }
            SQLTools.ExecuteNonQuery(q);
            return("=");
        }
Esempio n. 5
0
        public static void ApproveUnassignment(int RequestId)
        {
            DataTable de            = SQLTools.ExecuteQuery($@"select * from request
                                                        left join request_unassign on request_unassign.RID = request.RID
                                                        where request.rid={RequestId};");
            DateTime  DateEffective = DateTime.Parse(de.Rows[0]["dateeffective"].ToString());
            // 1.) Get all GIDs of guards in RID
            DataTable GuardsToBeDismissed = SQLTools.ExecuteQuery(@"select guards.gid as gid, sduty_assignment.aid as aid from guards 
                                            left join sduty_assignment on sduty_assignment.GID = guards.gid
                                            left join request_unassign on request_unassign.gid = guards.gid
                                            where rid = " + RequestId + ";");

            foreach (DataRow e in GuardsToBeDismissed.Rows)
            {
                // 1A) Set scheds to inactive
                String q = @"UPDATE `msadb`.`dutydetails` SET `DStatus`='" + Enumeration.DutyDetailStatus.Inactive + "' WHERE `AID`='" + e["aid"] + "';";
                SQLTools.ExecuteNonQuery(q);
                // 2.) Set assignment to dismissed (IF they have schedules active)
                q = $@"UPDATE `msadb`.`sduty_assignment` SET `AStatus`='{
                        Enumeration.AssignmentStatus.Inactive
                    }', UnassignedOn='{DateEffective:yyyy-MM-dd}' WHERE `gid`='{e["gid"]}';";
                SQLTools.ExecuteNonQuery(q);
                // 3.) Set guard to Inactive (BUT NOT DISMISSED)
                q = $@"UPDATE `msadb`.`guards` SET `GStatus`='{Enumeration.GuardStatus.PendingPayroll}' WHERE `GID`='{e[0]}'";
                SQLTools.ExecuteNonQuery(q);
                SQLTools.ExecuteQuery($@"call init_checkdate_gstatus_onapprove({e[0]})");
            }
            // Step 4
            UpdateRequestStatus(RequestId, Enumeration.RequestStatus.Approved, Login.LoggedInUser);
        }
Esempio n. 6
0
        /// <summary>
        /// Adds an unassignment request for the specified guards.
        /// </summary>
        /// <param name="cid">Client ID</param>
        /// <param name="gid">An array of Guard ID's to be dismissed</param>
        /// <param name="ReportType">Enumeration.ReportType (Incident)</param>
        /// <param name="pcompleting">Idk unsa ni na field.</param>
        /// <param name="EventDate">Date of event.</param>
        /// <param name="location">Brief location description</param>
        /// <param name="description">Brief description of incident.</param>
        public static void AddUnassignmentRequest(int cid, int[] gid, int ReportType, String pcompleting, DateTime EventDate,
                                                  String location, String description, DateTime DateEffective)
        {
            // 1.) Add Incident Report
            String q = String.Format(@"INSERT INTO `msadb`.`incidentreport` 
                         (`ReportType`, `DateEntry`, `PCompleting`, `EventDate`, `EventLocation`, `Description`) 
                         VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}');",
                                     ReportType, SQLTools.getDateTime(), pcompleting, EventDate.ToString("yyyy-MM-dd"), location, description
                                     );

            SQLTools.ExecuteNonQuery(q);
            // 2.) Insert a dismissal request.\
            // 2a: Get last inserted Incident Report (link this)
            int IncidentId = int.Parse(SQLTools.getLastInsertedId("IncidentReport", "iid"));

            // 2b: Insert request
            q = "INSERT INTO `msadb`.`request` (`RequestType`, `CID`, `DateEntry`,`rstatus`) VALUES ('{0}', '{1}', '{2}','{3}')";
            q = string.Format(q, Enumeration.RequestType.Dismissal, cid, SQLTools.getDateTime(), Enumeration.RequestStatus.Pending);
            SQLTools.ExecuteNonQuery(q);
            String lid = SQLTools.getLastInsertedId("request", "rid");

            for (int c = 0; c < gid.Length; c++)
            {
                q = $@"INSERT INTO `msadb`.`request_unassign` (`RID`, `gid`, `iid`, `DateEffective`) VALUES ('{lid.ToString()}', '{ gid[c]}', '{IncidentId}', '{DateEffective:yyyy-MM-dd}');";
                SQLTools.ExecuteNonQuery(q);
            }
        }
Esempio n. 7
0
        public static void UpdateCertifier(int ccid, string fn, string mn, string ln, string contactno)
        {
            var q =
                $@"UPDATE `msadb`.`certifier` SET `fn`='{fn}', `mn`='{mn}', `ln`='{ln}', `contactno`='{contactno}' WHERE `ccid`='{ccid}';";

            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 8
0
        public void SetCertifiedBy(int AID, int cert)
        {
            Period p = GetCurrentPayPeriod();
            String q = @"UPDATE `msadb`.`period` SET `certby`='" + cert + "' WHERE `GID`='" + GID + "' AND month='" + p.month + "' AND period='" + p.period + "' AND year='" + p.year + "';";

            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 9
0
        public static void AddHoliday(SelectionRange r, string desc, int type, int trans)
        {
            var q = $@"
            call msadb.proc_holiday_addholiday('{r.Start:yyyy-MM-dd}', '{r.End:yyyy-MM-dd}', '{desc}', {type}, {trans});
            ";

            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 10
0
        public static void AddClient(string name, string streetNo, string street, string brgy, string city, string contactPerson, string contactNo, string Manager, double OfficerRate)
        {
            String q = $@"INSERT INTO `msadb`.`Client` 
                        (`Name`, `ClientStreetNo`, `ClientStreet`,`ClientBrgy`,`ClientCity`,`ContactPerson`,`ContactNo`,`Manager`,`CStatus` ,`ofcrate` ) 
                        VALUES ('{name}', '{streetNo}', '{street}', '{brgy}', '{city}', '{contactPerson}', '{contactNo}', '{Manager}', '{Enumeration.ClientStatus.Inactive}', '{OfficerRate}');";

            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 11
0
        public static void ChangeUsername(int accid, string NewUname)
        {
            var q = $@"
                            UPDATE `msadb`.`account` SET 
                            `uname`='{NewUname}' 
                            WHERE `accid`='{accid}';
                    ";

            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 12
0
        public static void DismissDuty(int did, DateTime dismissal_date)
        {
            // Set duty detail to inactive.
            // Previous duty na ni niya.
            String q = $@"UPDATE `msadb`.`dutydetails` 
                            SET `DStatus`={Enumeration.DutyDetailStatus.Inactive},
                            `Date_Dismissal`='{dismissal_date:yyyy-MM-dd}'
                            WHERE `DID`={did}";

            SQLTools.ExecuteNonQuery(q);
            Console.WriteLine(q);
        }
Esempio n. 13
0
        public static void AddUnassignmentRequestNoIncident(int cid, int[] gid, DateTime DateEffective)
        {
            // 2b: Insert request
            var q = "INSERT INTO `msadb`.`request` (`RequestType`, `CID`, `DateEntry`,`rstatus`) VALUES ('{0}', '{1}', '{2}','{3}')";

            q = string.Format(q, Enumeration.RequestType.Dismissal, cid, SQLTools.getDateTime(), Enumeration.RequestStatus.Pending);
            SQLTools.ExecuteNonQuery(q);
            String lid = SQLTools.getLastInsertedId("request", "rid");

            for (int c = 0; c < gid.Length; c++)
            {
                q = $@"INSERT INTO `msadb`.`request_unassign` (`RID`, `gid`, `DateEffective`) VALUES ('{lid.ToString()}', '{ gid[c]}', '{DateEffective:yyyy-MM-dd}');";
                SQLTools.ExecuteNonQuery(q);
            }
        }
Esempio n. 14
0
        public void SetAttendance(int AtID, int ti_hh, int ti_mm, String ti_ampm, int to_hh, int to_mm, String to_ampm)
        {
            int      did = SQLTools.GetInt("select did from attendance where AtID=" + AtID);
            TimeSpan ts  = GetTimeDiff(ti_hh, ti_mm, ti_ampm, to_hh, to_mm, to_ampm);
            DateTime ti  = GetDateTime(ti_hh, ti_mm, ti_ampm);
            DateTime to  = GetDateTime(to_hh, to_mm, to_ampm);
            //compare with tama na sched for overtime
            DataRow  dt          = SQLTools.ExecuteQuery("select * from dutydetails where DID=" + did).Rows[0];
            DateTime start_night = GetDateTime(10, 00, "PM");
            DateTime end_night   = GetDateTime(6, 0, "AM").AddDays(1);
            String   q           = @"UPDATE `msadb`.`attendance` SET `TimeIn`='{1}', `TimeOut`='{2}'  WHERE `AtID`='{0}';";

            q = Format(q, AtID, ti.ToString("hh:mm tt"), to.ToString("hh:mm tt"));
            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 15
0
        public static string UpdateDutyDetail(int did, String TI_hr, String TI_min, String TI_ampm, String TO_hr, String TO_min, String TO_ampm, Days days)
        {
            string    wq = $@"SELECT * FROM msadb.dutydetails where did = '{did}';";
            DataTable dt = SQLTools.ExecuteQuery(wq);
            int       aid;

            if (dt.Rows.Count != 0)
            {
                aid = int.Parse(dt.Rows[0]["aid"].ToString());
            }
            else
            {
                MessageBox.Show("No duty details found.");
                return("X");
            }

            DateTime deff      = DateTime.Parse(dt.Rows[0]["date_effective"].ToString());
            DateTime dend      = DateTime.Parse(dt.Rows[0]["date_dismissal"].ToString());
            bool     isOverlap = HasOverlap(aid, did, ($@"{TI_hr}:{TI_min}"), ($@"{TO_hr}:{TO_min}"), days, deff, dend);

            if (isOverlap)
            {
                return("olap");
            }
            DateTime      ti       = DateTime.Parse($"3/1/0001 {TI_hr}:{TI_min} {TI_ampm}");
            DateTime      to       = DateTime.Parse($"3/1/0001 {TO_hr}:{TO_min} {TO_ampm}");
            DateTime      to_props = ti.AddHours(8);
            HourProcessor hp       = new HourProcessor(ti, to, ti, to);
            TimeSpan      e        = hp.GetTotalTS();

            //if (e.TotalHours > 8) { return ">"; } else if (e.TotalHours < 8) { return "<"; }
            Console.Write(e.TotalMinutes);
            String q = $@"
                        UPDATE `msadb`.`dutydetails` SET 
                        `TI_hh`='{TI_hr}', `TI_mm`='{TI_min}', `TI_period`='{TI_ampm}', 
                        `TO_actual_hh`='{TO_hr}', `TO_actual_mm`='{TO_min}', `TO_actual_period`='{TO_ampm}',
                        `TO_hh`='{to_props:hh}', `TO_mm`='{to_props:mm}', `TO_period`='{to_props:tt}',
                        `Mon`='{ToInt32(days.Mon)}', `Tue`='{ToInt32(days.Tue)}', 
                        `Wed`='{ ToInt32(days.Wed)}', `Thu`='{ToInt32(days.Thu)}', 
                        `Fri`='{ToInt32(days.Fri)}', `Sat`='{ToInt32(days.Sat)}', 
                        `Sun`='{ToInt32(days.Sun)}', `minutediff`={(int)(e.TotalMinutes)}
                        WHERE `DID`='{did}';
                         ";

            SQLTools.ExecuteNonQuery(q);
            return("=");
        }
Esempio n. 16
0
        /// <summary>
        /// Adds an assignment request. Note: This isn't an actual assignment yet.
        /// </summary>
        /// <param name="CID">Client ID (the requester)</param>
        /// <param name="AssStreetNo"></param>
        /// <param name="AssStreetName"></param>
        /// <param name="AssBrgy"></param>
        /// <param name="AssCity"></param>
        /// <param name="ContractStart"></param>
        /// <param name="ContractEnd">DateTime ang ipass diri</param>
        /// <param name="NoGuards">Number of Guards</param>
        public static void AddAssignmentRequest(int CID, string AssStreetNo, string AssStreetName, string AssBrgy, string AssCity, DateTime ContractStart, DateTime ContractEnd, int NoGuards)
        {
            String madeon = DateTime.Now.ToString("yyyy-MM-dd");
            String q1     = String.Format("INSERT INTO `msadb`.`request` (`RequestType`, `CID`, `DateEntry`,`rstatus`) VALUES ('{0}', '{1}', '{2}','{3}');",
                                          Enumeration.RequestType.Assignment, CID, madeon, Enumeration.RequestStatus.Pending);

            SQLTools.ExecuteNonQuery(q1);
            String rid   = SQLTools.getLastInsertedId("request", "rid");
            String query = String.Format("INSERT INTO `msadb`.`request_assign` " +
                                         " ( `ContractStart`, `ContractEnd`, `streetno`, `streetname`, `brgy`, `city`,`noguards`,`rid`)" +
                                         " VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}');",
                                         ContractStart.ToString("yyyy-MM-dd"), ContractEnd.ToString("yyyy-MM-dd"),
                                         AssStreetNo, AssStreetName, AssBrgy, AssCity, NoGuards, rid);

            Console.WriteLine("AddAssignmentRequest: \n" + query);
            SQLTools.ExecuteNonQuery(query);
        }
Esempio n. 17
0
        public static void UpdateClient(string Cid, string name, string streetNo, string street, string brgy,
                                        string city, string contactPerson, string contactNo, string Manager, double OfficerRate)
        {
            var q = $@"UPDATE `msadb`.`Client` SET 
                                `Name` = '{name}', 
                                `ClientStreetNo` = '{streetNo}', 
                                `ClientStreet` = '{street}',
                                `ClientBrgy`= '{brgy}', 
                                `ClientCity`= '{city}',
                                `ContactPerson`= '{contactPerson}',
                                `ContactNo`= '{contactNo}',
                                `Manager`= '{Manager}',
                                `OfcRate`={OfficerRate}
                                WHERE CID = '{Cid}';";

            SQLTools.ExecuteNonQuery(q);
        }
Esempio n. 18
0
        public static bool ChangePassword(int accid, string NewPassword, string OldPassword)
        {
            String    x  = @"select hash from account where accid='" + accid + "'";
            DataTable dt = SQLTools.ExecuteQuery(x);

            if (Crypt.Verify(OldPassword, dt.Rows[0]["hash"].ToString()))
            {
                var q = $@"
                            UPDATE `msadb`.`account` SET 
                            `hash`='{Crypt.HashPassword(NewPassword)}' 
                            WHERE `accid`='3';
                    ";
                SQLTools.ExecuteNonQuery(q);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 19
0
        /// <summary>
        /// Returns a DataTable listing the Summary of Duty Details of a specific assignment.
        /// </summary>
        /// <param name="AID">Assignment ID</param>
        /// <returns>Columns: ["did", "TimeIn", "TimeOut", "Days"]</returns>
        public static DataTable GetDutyDetailsSummary(int AID)
        {
            SQLTools.ExecuteNonQuery("call init_checkdate_dutydetail();");
            DataTable dt =
                SQLTools.ExecuteQuery(@"
                    select did, concat (ti_hh,':',ti_mm,' ',ti_period) as TimeIn,
                    concat (to_actual_hh,':',to_actual_mm,' ',to_actual_period) as TimeOut,
                    'days_columnMTWThFSSu' as days, 
                    DATE_FORMAT(date_effective, '%Y-%m-%d') AS DateEffective, 
                    case DATE_FORMAT(date_dismissal, '%Y-%m-%d')
						when '9999-12-31' then 'Not Set'
						else DATE_FORMAT(date_dismissal, '%Y-%m-%d')
                    end AS DateDismissal  
               from 
					dutydetails  where  AID="                     + AID);

            foreach (DataRow e in dt.Rows)
            {
                e.SetField("days", GetDays(int.Parse(e["did"].ToString())).ToString());
            }
            return(dt);
        }
Esempio n. 20
0
        public static void AddAssignment(int rid, int[] gid)
        {
            DataRow df = SQLTools.ExecuteQuery($@"select * from request where rid='{rid}'").Rows[0];

            // First check if rid is type assignment.
            if (df["requesttype"].ToString() == Enumeration.RequestType.Assignment.ToString())
            {
                // FUNCTION BODY
                DataRow dtl = SQLTools.ExecuteQuery($@"
                    select * from request 
				    left join request_assign on request_assign.RID = request.RID
				    left join sduty_assignment on sduty_assignment.RAID=request_assign.RAID where request_assign.rid={rid};
                ").Rows[0];

                // Get RID of guard.
                String raid = dtl["RAID"].ToString();
                foreach (int g in gid)
                {
                    DateTime consta = DateTime.Parse(dtl["contractstart"].ToString());
                    DateTime conend = DateTime.Parse(dtl["contractend"].ToString());
                    // Add assignment in assignment table
                    String q = $@"INSERT INTO `msadb`.`sduty_assignment` (`GID`, `RAID`, `AStatus`, `AssignedOn`, `cid`) VALUES ('{g}', '{raid}', '{Enumeration.Schedule.Pending}', 
                                '{consta.ToString("yyyy-MM-dd")}', '{df["cid"].ToString()}');";
                    SQLTools.ExecuteNonQuery(q);
                    // SQLTools.ExecuteNonQuery(eventddl_cs);      // contract start trigger
                    // SQLTools.ExecuteNonQuery(eventddl_ce);      // contract end trigger
                }
                UpdateRequestStatus(rid, Enumeration.RequestStatus.Active, Login.LoggedInUser);
                Data.InitGuardStatusAndDutyAssignments();
            }
            else
            {
                MessageBox.Show("Request is not an assignment.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            SQLTools.ExecuteQuery("call init_status_clientstatus()");
            SQLTools.ExecuteNonQuery("call msadb.init_checkdate_assignmentstatus();");
        }
Esempio n. 21
0
        public static bool Authenticate(string uname, string pword)
        {
            int uid;

            try {
                String    q  = @"select * from account where uname='" + uname + "'";
                DataTable dt = SQLTools.ExecuteQuery_(q);
                //Console.WriteLine(Crypt.HashPassword("clerk"));
                string db_hash = dt.Rows[0]["hash"].ToString();
                if (Crypt.Verify(pword, db_hash))
                {
                    UserName     = dt.Rows[0]["uname"].ToString();
                    AccountType  = int.Parse(dt.Rows[0]["type"].ToString());
                    uid          = int.Parse(dt.Rows[0]["accid"].ToString());
                    LoggedInUser = uid;
                    SQLTools.conn.Close();
                    SQLTools.ExecuteNonQuery($@"
                    INSERT INTO `msadb`.`loginhistory` 
                    (`uid`, `session_start`) 
                    VALUES ('{uid}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}');
                    ");
                    SessionId = SQLTools.GetInt("select last_insert_id()");
                    SQLTools.ExecuteNonQuery($@"SET @cuser={SessionId};");
                    SQLTools.ExecuteNonQuery($@"call init_checkdate_all");
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception) {
                SQLTools.conn.Close();
                return(false);
            }
        }
Esempio n. 22
0
 public static void DeleteBasicPay(int BasicPayId)
 {
     SQLTools.ExecuteNonQuery($@"delete FROM msadb.basicpay where bpid={BasicPayId};");
 }
Esempio n. 23
0
 public static void DeleteContrib(int contrib_id)
 {
     SQLTools.ExecuteNonQuery($@"DELETE FROM contribdetails where contrib_id={contrib_id}");
 }
Esempio n. 24
0
        /// <summary>
        /// Use only for pending dates.
        /// </summary>
        public static void DeleteRate(int rates_id)
        {
            string deletequery = $@"delete FROM msadb.rates where rid = {rates_id};";

            SQLTools.ExecuteNonQuery(deletequery);
        }
Esempio n. 25
0
 public static void RemoveHoliday(int hid)
 {
     SQLTools.ExecuteNonQuery($@"call msadb.proc_holiday_remove({hid});");
 }
Esempio n. 26
0
 public static void AddGuardsDependent(int Gid, int Rel, string First, string Middle, string Last)
 {
     SQLTools.ExecuteNonQuery("INSERT INTO Dependents(DRelationship, GID, FN, MN, LN) VALUES ('" + Rel + "','" + Gid + "','" + First + "','" + Middle + "','" + Last + "')");
 }
Esempio n. 27
0
 public static void AddGuardBasicInfo(string FirstNameBX, string MiddleNameBX, string LastNameBX, DateTime BirthdateBX, int gender, string HeightBX, string WeightBX, string ReligionBX, int CVStatusBX, string CellNoBX, string TellNoBX, string LicenseNoBX, string SSSNoBX, string TINNoBX, string PhilHealthBX, string PrevAgencyBX, string PrevAssBX, int EdAttBX, string CourseBX, string MilTrainBX, string EmergBX, string EmergencyNoBX, int gtype)
 {
     SQLTools.ExecuteNonQuery(@"INSERT INTO Guards(FN, MN, LN, GStatus, BDate, Gender, Height, Weight, Religion, CivilStatus, CellNo, TelNo, LicenseNo, SSS, TIN, PhilHealth, PrevAgency, PrevAss, EdAtt, Course, MilitaryTrainings, EmergencyContact, EmergencyNo, gtype) VALUES ('" + FirstNameBX + "','" + MiddleNameBX + "','" + LastNameBX + "','" + Enumeration.GuardStatus.Inactive + "','" + BirthdateBX.Month + "/" + BirthdateBX.Day + "/" + BirthdateBX.Year + "','" + gender + "','" + HeightBX + "','" + WeightBX + "','" + ReligionBX + "','" + CVStatusBX + "','" + CellNoBX + "','" + TellNoBX + "','" + LicenseNoBX + "','" + SSSNoBX + "','" + TINNoBX + "','" + PhilHealthBX + "','" + PrevAgencyBX + "','" + PrevAssBX + "','" + EdAttBX + "','" + CourseBX + "','" + MilTrainBX + "','" + EmergBX + "','" + EmergencyNoBX + $"', '{gtype}')");
 }
Esempio n. 28
0
        public static void RemoveDependent(int DependentId)
        {
            var _ = $@"delete from dependents where deid={DependentId}";

            SQLTools.ExecuteNonQuery(_);
        }
Esempio n. 29
0
 public static void UpdateGuardType(int gid, int gtype)
 {
     SQLTools.ExecuteNonQuery($@"UPDATE `msadb`.`guards` SET `gtype`='{gtype}' WHERE `GID`='{gid}';");
 }
Esempio n. 30
0
 public static void UpdateGuardBasicInfo(int Gid, string FirstNameBX, string MiddleNameBX, string LastNameBX, DateTime BirthdateBX, int gender, string HeightBX, string WeightBX, string ReligionBX, int CVStatusBX, string CellNoBX, string TellNoBX, string LicenseNoBX, string SSSNoBX, string TINNoBX, string PhilHealthBX, string PrevAgencyBX, string PrevAssBX, int EdAttBX, string CourseBX, string MilTrainBX, string EmergBX, string EmergencyNoBX)
 {
     SQLTools.ExecuteNonQuery("UPDATE Guards SET FN = '" + FirstNameBX + "', MN = '" + MiddleNameBX + "', LN = '" + LastNameBX + "', BDate = '" + BirthdateBX.Month + "/" + BirthdateBX.Day + "/" + BirthdateBX.Year + "', Gender =  '" + gender + "', Height = '" + HeightBX + "', Weight = '" + WeightBX + "', Religion = '" + ReligionBX + "', CivilStatus = '" + CVStatusBX + "', CellNo = '" + CellNoBX + "', TelNo = '" + TellNoBX + "', LicenseNo = '" + LicenseNoBX + "', SSS = '" + SSSNoBX + "', TIN = '" + TINNoBX + "', PhilHealth = '" + PhilHealthBX + "', PrevAgency = '" + PrevAgencyBX + "', PrevAss = '" + PrevAssBX + "', EdAtt = '" + EdAttBX + "', Course = '" + CourseBX + "', MilitaryTrainings = '" + MilTrainBX + "', EmergencyContact = '" + EmergBX + "', EmergencyNo = '" + EmergencyNoBX + "' WHERE GID=" + Gid);
 }