Пример #1
0
        private void getPayrollISAPRecord()
        {
            conDB       = new ConnectionDB();
            queryString = "SELECT empID, isap, concat(lastname,', ', firstname) as fullname, tblpayroll.startdate" +
                          " FROM (tblpayroll INNER JOIN tblemployees ON tblpayroll.empID = tblemployees.ID)" +
                          " WHERE tblpayroll.isDeleted = 0 AND empID = ? AND isap > 0";

            parameters = new List <string>();
            parameters.Add(employeeID);

            ISAPModel isapMod = new ISAPModel();

            MySqlDataReader reader = conDB.getSelectConnection(queryString, parameters);

            while (reader.Read())
            {
                isapMod.FullName = reader["fullname"].ToString();
                DateTime dte = DateTime.Parse(reader["startdate"].ToString());
                isapMod.DateAdded   = dte.ToShortDateString();
                isapMod.CurrentISAP = reader["isap"].ToString();
                isapMod.Remarks     = "AUTO-PAYSLIP";
                lstISAP.Add(isapMod);
                isapMod = new ISAPModel();
            }

            conDB.closeConnection();
        }
Пример #2
0
        private void getISAPRecord()
        {
            conDB   = new ConnectionDB();
            lstISAP = new List <ISAPModel>();
            ISAPModel isapMod = new ISAPModel();

            queryString = "SELECT tblemployees.ID, concat(lastname,', ', firstname) as fullname, dateadded, " +
                          "existingisap FROM (tblemployees INNER JOIN tblisap ON " +
                          "tblemployees.ID = tblisap.empID) " +
                          "WHERE tblemployees.isDeleted = 0 AND tblisap.isDeleted = 0 AND tblemployees.ID = ?";

            parameters = new List <string>();
            parameters.Add(employeeID);

            MySqlDataReader reader = conDB.getSelectConnection(queryString, parameters);

            while (reader.Read())
            {
                isapMod.FullName = reader["fullname"].ToString();
                DateTime dte = DateTime.Parse(reader["dateadded"].ToString());
                isapMod.DateAdded   = dte.ToShortDateString();
                isapMod.CurrentISAP = reader["existingisap"].ToString();
                isapMod.Remarks     = "MANUAL-ADMIN";
                lstISAP.Add(isapMod);
                isapMod = new ISAPModel();
            }

            conDB.closeConnection();
        }
Пример #3
0
        private void btnDetails_Click(object sender, RoutedEventArgs e)
        {
            ISAPModel intact = dgvISAP.SelectedItem as ISAPModel;

            if (intact != null)
            {
                ISAPDetails isDetails = new ISAPDetails(intact.empID);
                isDetails.ShowDialog();
            }
        }
Пример #4
0
        private List <ISAPModel> getISAPToADD()
        {
            List <ISAPModel> listISAP = new List <ISAPModel>();
            ISAPModel        isaps    = new ISAPModel();

            conDB = new ConnectionDB();

            queryString = "SELECT empID, sum(isap) as isap FROM tblpayroll WHERE tblpayroll.isDeleted = 0 GROUP BY empID";

            MySqlDataReader reader = conDB.getSelectConnection(queryString, null);

            while (reader.Read())
            {
                isaps.empID     = reader["empID"].ToString();
                isaps.ISAPtoAdd = reader["isap"].ToString();
                listISAP.Add(isaps);
                isaps = new ISAPModel();
            }
            conDB.closeConnection();
            return(listISAP);
        }
Пример #5
0
        private List <ISAPModel> getISAPRecord()
        {
            List <ISAPModel> lstisap = new List <ISAPModel>();
            ISAPModel        isap    = new ISAPModel();

            conDB = new ConnectionDB();
            double isapAddedByAdmin = 0;

            queryString = "SELECT tblisap.empid, sum(existingisap) as existingisap, concat(lastname,' , ', firstname) as fullname, " +
                          "dateadded FROM (tblisap INNER JOIN tblemployees ON " +
                          "tblisap.empID = tblemployees.ID) WHERE tblisap.isDeleted = 0 GROUP BY tblisap.empid";

            MySqlDataReader reader = conDB.getSelectConnection(queryString, null);

            while (reader.Read())
            {
                isap.empID    = reader["empID"].ToString();
                isap.FullName = reader["fullname"].ToString();
                double current = Convert.ToDouble(reader["existingisap"].ToString());

                foreach (ISAPModel ism in lstISAPToAdd)
                {
                    if (isap.empID.Equals(ism.empID))
                    {
                        current = current + Convert.ToDouble(ism.ISAPtoAdd);
                    }
                }

                DateTime dte = DateTime.Parse(reader["dateadded"].ToString());
                isap.DateAdded   = dte.ToShortDateString();
                isap.CurrentISAP = current.ToString();
                isapAddedByAdmin = isapAddedByAdmin + current;
                lstisap.Add(isap);
                isap = new ISAPModel();
            }
            lblTotalISAP.Content = "Total: " + isapAddedByAdmin.ToString("N0");
            conDB.closeConnection();
            return(lstisap);
        }