| | |
| | | if(admAsk.Step == "提交") |
| | | { |
| | | //请假时间不能重叠 |
| | | var qingjia = _signinService.GetAskLeaveChongdie(curentuser.Id, admAsk.StratTime.Value, admAsk.EndTime.Value); |
| | | if (qingjia.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该时间段已经有请假!"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | //var qingjia = _signinService.GetAskLeaveChongdie(curentuser.Id, admAsk.StratTime.Value, admAsk.EndTime.Value); |
| | | // if (qingjia.Count > 0) |
| | | // { |
| | | // resultEntity.Result = false; |
| | | // resultEntity.Message = "该时间段已经有请假!"; |
| | | // return JsonConvert.SerializeObject(resultEntity); |
| | | // } |
| | | |
| | | //请假超过三天,必须提前三天以上请假! |
| | | if (admAsk.LaveDay.Value >= 3 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(3)) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "请假超过三天,必须提前三天以上请假!"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | ////请假超过三天,必须提前三天以上请假! |
| | | // if (admAsk.LaveDay.Value >= 3 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(3)) |
| | | // { |
| | | // resultEntity.Result = false; |
| | | // resultEntity.Message = "请假超过三天,必须提前三天以上请假!"; |
| | | // return JsonConvert.SerializeObject(resultEntity); |
| | | // } |
| | | |
| | | //请假超过七天,必须提前七天以上请假! |
| | | if (admAsk.LaveDay.Value >= 7 && admAsk.StratTime.Value.Date < DateTime.Now.Date.AddDays(7)) |
| | |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | |
| | | //销假必须三天以内 |
| | | if (leaveOff.StratTime.Value.Date < DateTime.Now.Date.AddDays(-3)) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "请在72小时内进行销假处理,超过72小时无法提交"; |
| | | return JsonConvert.SerializeObject(resultEntity); |
| | | } |
| | | ////销假必须三天以内 |
| | | //if (leaveOff.EndTime.Value.Date < DateTime.Now.Date.AddDays(-4)) |
| | | //{ |
| | | // resultEntity.Result = false; |
| | | // resultEntity.Message = "请在72小时内进行销假处理,超过72小时无法提交"; |
| | | // return JsonConvert.SerializeObject(resultEntity); |
| | | //} |
| | | } |
| | | |
| | | using (TransactionScope scope = new TransactionScope()) |