Exemple #1
0
 public void AskForLeaveM(LeaveDetails ld, Manager m)
 {
     try
     {
         selectCommand = new MySqlCommand("insert into Aurora.leavedescription(leaveid,type,description,fromd,tod,employeeid,accept,tempdif)values('" + null + "','" + ld.type + "','" + ld.Description + "','" + ld.startdate + "','" + ld.enddate + "','" + m.Id + "','" + 0 + "','" + ld.tempd + "');", myCon);
         myCon.Open();
         myReader = selectCommand.ExecuteReader();
     }
     catch (Exception ex) { }
 }
Exemple #2
0
        public void AcceptRequest(LeaveDetails le)
        {
            try
            {
                selectCommand = new MySqlCommand("update  aurora.leavedescription  set  accept = '" + 1 + "' where leaveid='" + le.Leaveid + "';", myCon);
                myCon.Open();
                myReader = selectCommand.ExecuteReader();

                while (myReader.Read())
                {
                }
            }
            catch (Exception ex) { }
        }
Exemple #3
0
        public void rejectRequest(LeaveDetails le)
        {
            try
            {
                selectCommand = new MySqlCommand("DELETE FROM aurora.leavedescription WHERE leaveid=" + le.Leaveid + "; ", myCon);
                myCon.Open();
                myReader = selectCommand.ExecuteReader();

                while (myReader.Read())
                {
                }
            }
            catch (Exception ex) { }
        }
Exemple #4
0
        public int retreiveCount(LeaveDetails le)
        {
            selectCommand = new MySqlCommand("select tempDif from leavedescription where leaveid='" + le.Leaveid + "';", myCon);
            myCon.Open();
            myReader = selectCommand.ExecuteReader();

            while (myReader.Read())
            {
                le.tempd = myReader.GetInt16("tempDif");
                int x = le.tempd;
                return(x);
            }
            return(0);


            myCon.Close();
        }
Exemple #5
0
        public void AcceptLeave(string x, LeaveDetails ld)
        {
            try
            {
                selectCommand = new MySqlCommand("select * from aurora.leavedescription where  employeeid=" + x + " order by leaveid desc Limit 1; ", myCon);
                myCon.Open();
                myReader = selectCommand.ExecuteReader();

                while (myReader.Read())
                {
                    ld.type        = myReader.GetString("type");
                    ld.Description = myReader.GetString("description");
                    ld.startdate   = myReader.GetString("fromd");
                    ld.enddate     = myReader.GetString("tod");
                    ld.accept      = myReader.GetString("accept");
                }
            }
            catch (Exception ex) { }
        }