public static void ConditionBackUpdate(int TransactionTypeID, int AnchorTransactionID, int idConditionProduct, int amount) { TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailRequest requestDetail = new TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailRequest() { TransactionTypeID = TransactionTypeID, TransactionID = AnchorTransactionID, ConditionID = idConditionProduct }; TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailResponse responseDetail = new TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailResponse() { TransactionTypeConditionDetail = new TransactionTypeConditionDetail() }; responseDetail.TransactionTypeConditionDetail.idCondition = idConditionProduct; responseDetail.TransactionTypeConditionDetail.idTransactionAnchor = AnchorTransactionID; responseDetail.TransactionTypeConditionDetail.idTransactionType = TransactionTypeID; int actualAmountDetail = (int)TransactionTypeConditionDetailBussines.Select.GetTransactionTypeConditionDetail(requestDetail).TransactionTypeConditionDetail.amount; responseDetail.TransactionTypeConditionDetail.amount = actualAmountDetail - amount; TransactionTypeConditionDetailBussines.Update.TransactionTypeConditionDetail(responseDetail); }
private static void ConditionDetail(int TransactionTypeID, int AnchorTransactionID, int idConditionProduct, int amount) { #region transaction Detail TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailRequest requestDetail = new TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailRequest() { TransactionTypeID = TransactionTypeID, TransactionID = AnchorTransactionID, ConditionID = idConditionProduct }; TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailResponse responseDetail = new TransactionTypeConditionDetailBussines.GetTransactionTypeConditionDetailResponse() { TransactionTypeConditionDetail = new TransactionTypeConditionDetail() }; responseDetail.TransactionTypeConditionDetail.idCondition = idConditionProduct; responseDetail.TransactionTypeConditionDetail.idTransactionAnchor = AnchorTransactionID; responseDetail.TransactionTypeConditionDetail.idTransactionType = TransactionTypeID; if (TransactionTypeConditionDetailBussines.Select.GetTransactionTypeConditionDetailCount(requestDetail).Exist) { int actualAmountDetail = (int)TransactionTypeConditionDetailBussines.Select.GetTransactionTypeConditionDetail(requestDetail).TransactionTypeConditionDetail.amount; responseDetail.TransactionTypeConditionDetail.amount = actualAmountDetail + amount; TransactionTypeConditionDetailBussines.Update.TransactionTypeConditionDetail(responseDetail); } else { responseDetail.TransactionTypeConditionDetail.amount = amount; TransactionTypeConditionDetailBussines.Insert.TransactionTypeConditionDetail(responseDetail); } #endregion }