/// <summary> /// </summary> public ApproveOutApplicationItem(int itemID, int accountID, bool isAgree, string remark) { _Account = _DalAccountBll.GetAccountById(accountID); _OutApplicationItem = _DalOutApplication.GetOutApplicationItemByItemID(itemID); _OutApplication = _DalOutApplication.GetOutApplicationByOutApplicationID(_OutApplicationItem.OutApplicationID); _ItemID = itemID; _Remark = remark; _IsAgree = isAgree; _IsAdjust = _OutApplicationItem.Adjust; _AdjustHour = _OutApplicationItem.AdjustHour; }
/// <summary> /// </summary> public static bool CancelOneItem(OutApplicationItem item, Account account, string remark, IOutApplication dalOutApplication, OutDiyProcessUtility outDiyProcessUtility, OutApplication outApplication) { item = dalOutApplication.GetOutApplicationItemByItemID(item.ItemID); bool valide = RequestStatus.CanCancelStatus(item.Status); if (valide) { using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { RequestStatus status = RequestStatus.Cancelled; if (outApplication.OutType.ID == OutType.InCity.ID || outApplication.OutType.ID == OutType.Train.ID) { status = RequestStatus.ApproveCancelPass; ConfirmMessage confirmmessage = new ConfirmMessage(); confirmmessage.FinishPhoneMessageOperation( new PhoneMessageType(PhoneMessageEnumType.OutApplication, item.ItemID)); valide = false; } dalOutApplication.UpdateOutApplicationItemStatusByItemID(item.ItemID, status); OutApplicationFlow OutApplicationFlow = new OutApplicationFlow(0, account, DateTime.Now, remark, RequestStatus.Cancelled, 1); dalOutApplication.InsertOutApplicationFlow(item.ItemID, OutApplicationFlow); ts.Complete(); } } return(valide); }
protected override void Validation() { _OutApplicationItem = _DalOutApplication.GetOutApplicationItemByItemID(_ItemID); _OutApplication = _DalOutApplication.GetOutApplicationByOutApplicationID(_OutApplicationItem.OutApplicationID); if (_OutApplicationItem == null) { HrmisUtility.ThrowException(HrmisUtility._OutApplicationItem_Not_Exit); } }
/// <summary> /// /// </summary> public OutConfirmPhone(int outApplicationId, int itemid) { _OutApplication = _OutApplicationDal.GetOutApplicationByOutApplicationID(outApplicationId); _OutApplicationItem = _OutApplicationDal.GetOutApplicationItemByItemID(itemid); _OutApplication.Account = _AccountBll.GetAccountById(_OutApplication.Account.Id); }
/// <summary> /// /// </summary> public static bool ApproveOneItem(OutApplicationItem item, bool isAgree, Account account, OutApplication outApplication, string remark, IOutApplication dalOutApplication, OutDiyProcessUtility outDiyProcess, bool isAdjust, bool isChangeAdjust, decimal adjustHour, out Account nextOperator) { if (!isAdjust) { adjustHour = 0; } nextOperator = null; item = dalOutApplication.GetOutApplicationItemByItemID(item.ItemID); item.AdjustHour = adjustHour; bool ans = RequestStatus.CanApproveStatus(item.Status) && account.Id == outDiyProcess.GetNextOperator(outApplication.DiyProcess, item, outApplication.Account.Id).Id; if (ans) { if (!isAgree) { using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { RequestStatus requestStatus = RequestUtility.GetStatus(item.Status, isAgree, 1); dalOutApplication.UpdateOutApplicationItemStatusByItemID(item.ItemID, requestStatus); dalOutApplication.InsertOutApplicationFlow(item.ItemID, new OutApplicationFlow(0, account, DateTime.Now, remark, requestStatus, -1)); nextOperator = null; item.Status = requestStatus; if (outApplication.OutType.ID == OutType.OutCity.ID) { if (isChangeAdjust) { dalOutApplication.UpdateOutApplicationItemAdjustByItemID(item.ItemID, isAdjust, adjustHour); item.Adjust = isAdjust; } new UpdateAdjustRestByOut(item, outApplication.Account.Id).Excute(); } ts.Complete(); } } else { //现在做到第几步,就是上一步加1 int step = outDiyProcess.GetNextStep(item.OutApplicationFlow, outApplication.DiyProcess); RequestStatus requestStatus = RequestUtility.GetStatus(item.Status, isAgree, step); OutApplicationFlow OutApplicationFlow = new OutApplicationFlow(0, account, DateTime.Now, remark, requestStatus, step); using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { dalOutApplication.InsertOutApplicationFlow(item.ItemID, OutApplicationFlow); dalOutApplication.UpdateOutApplicationItemStatusByItemID(item.ItemID, requestStatus); item.Status = requestStatus; if (outApplication.OutType.ID == OutType.OutCity.ID) { if (isChangeAdjust) { dalOutApplication.UpdateOutApplicationItemAdjustByItemID(item.ItemID, isAdjust, adjustHour); item.Adjust = isAdjust; } new UpdateAdjustRestByOut(item, outApplication.Account.Id).Excute(); } ts.Complete(); } nextOperator = outDiyProcess.GetNextOperator(outApplication.DiyProcess, step, outApplication.Account.Id); } } return(ans); }
/// <summary> /// </summary> public OutApplicationItem GetOutApplicationItemByItemID(int itemID) { return(_OutApplicationDal.GetOutApplicationItemByItemID(itemID)); }