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) { } }
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) { } }
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) { } }
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(); }
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) { } }