コード例 #1
0
        public JsonResult Update(ThirdPartyPaymentModel model)
        {
            var thirdpayment = PaymentService.FindThirdPartyPaymentById(model.ThirdPartyScheduleId);

            Dictionary <string, object> dicThirdPartySchedule = new Dictionary <string, object>();

            ActivityLogService.CreateDictionaryForThirdParty(ref dicThirdPartySchedule, thirdpayment);

            ActivityLogService.CreateActivityLog(new ActivityLog {
                Comment      = XmlHelper.SerializeKeyValuePairs("ThirdPartySchedule", dicThirdPartySchedule),
                ObjectTypeId = (int)AuditObjectType.PaymentThirdPartySchedule,
                ObjectId     = thirdpayment.ThirdPartyScheduleId.ToString()
            }, "ThirdPartySchedule.Update");

            thirdpayment.FirstInstallmentAmount  = 0;
            thirdpayment.SecondInstallmentAmount = 0;
            thirdpayment.SinglePaymentAmount     = 0;

            if (model.IsSinglePayment)
            {
                thirdpayment.SinglePaymentAmount = model.SinglePaymentAmount;
                thirdpayment.OrderAmount         = model.SinglePaymentAmount;
            }
            else
            {
                thirdpayment.FirstInstallmentAmount  = model.FirstInstallmentAmount;
                thirdpayment.SecondInstallmentAmount = model.SecondInstallmentAmount;
                thirdpayment.OrderAmount             = model.FirstInstallmentAmount + model.SecondInstallmentAmount;
            }
            thirdpayment.Comment          = model.Comment;
            thirdpayment.ModifiedDateTime = System.DateTime.UtcNow;
            thirdpayment.ModifiedBy       = WebHelper.GetUserName();

            PaymentService.ModifyThirdPayment(thirdpayment);

            return(Json(new BasicDataTablesResult(new { Status = "OK" })));
        }