Esempio n. 1
0
 // DELETE api/leavedetails/5
 public bool Delete(int id)
 {
     try
     {
         return(BLLLeaveDetails.Delete(id));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 2
0
 // GET api/leavedetails/5
 public BOLeaveDetails Get(int id)
 {
     try
     {
         return(BLLLeaveDetails.GetLeaveByEmployeeID(id));
     }
     catch (Exception)
     {
         return(new BOLeaveDetails());
     }
 }
Esempio n. 3
0
 // GET api/leavedetails
 public List <BOLeaveDetails> Get()
 {
     try
     {
         return(BLLLeaveDetails.GetAllList());
     }
     catch (Exception)
     {
         return(new BOLeaveDetailsList());
     }
 }
Esempio n. 4
0
 // POST api/leavedetails
 public string Post([FromBody] BOLeaveDetails LeaveDetailsObj)
 {
     try
     {
         int id    = LeaveDetailsObj != null ? LeaveDetailsObj.EmployeeID : 0;
         int count = BLLLeaveDetails.Save(LeaveDetailsObj, id > 0 ? true : false);
         return(count > 0 ? "Record saved successfully" : "There is a problem while saving record");
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }