コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public bool DeleteWorkTime(WorkTimeModel model)
 {
     try
     {
         return(scheduleDAO.DeleteWorkTime(model));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #4
0
 public int ModifyWorkTime(WorkTimeModel model)
 {
     try
     {
         return(scheduleDAO.ModifyWorkTime(model));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #5
0
        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);
        }