private BaseActionResult ModifyWorkTime(WorkTimeModel model) { BaseActionResult result = new BaseActionResult(); try { int returnCode = scheduleServcie.ModifyWorkTime(model); if (returnCode == 0) { result.Result = true; } else if (returnCode == 1) { result.Result = false; result.ReturnMessage = "There is time overlap,Please input other time range."; } else if (returnCode == 3) { result.Result = false; result.ReturnMessage = "This item has been deleted in other client."; } else { result.Result = false; result.ReturnMessage = "Unknown Errors."; } } catch (Exception ex) { result.Result = false; result.ReturnMessage = ex.Message; } return(result); }
private BaseActionResult AddWorkTime(WorkTimeModel model) { BaseActionResult result = new BaseActionResult(); try { int returnCode = scheduleServcie.AddWorkTime(model); if (returnCode == 0) { result.Result = true; } else if (returnCode == 1) { result.Result = false; result.ReturnMessage = "There is time overlap,Please input other time range."; } else if (returnCode == 3) { result.Result = false; result.ReturnMessage = "The work time name has been exist!"; } else { result.Result = false; result.ReturnMessage = "Unknown Errors."; } } catch (Exception ex) { result.Result = false; result.ReturnMessage = ex.Message; } return(result); }
public bool DeleteWorkTime(WorkTimeModel model) { try { return(scheduleDAO.DeleteWorkTime(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public int ModifyWorkTime(WorkTimeModel model) { try { return(scheduleDAO.ModifyWorkTime(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
private BaseActionResult DeleteWorkTime(WorkTimeModel model) { BaseActionResult result = new BaseActionResult(); try { if (scheduleServcie.DeleteWorkTime(model)) { result.Result = true; } else { result.Result = false; } } catch (Exception ex) { result.Result = false; result.ReturnMessage = ex.Message; } return(result); }