コード例 #1
0
ファイル: PaymentService.cs プロジェクト: anh120991/template
        /// <summary>
        /// Get chi tiết getListScheduleUnpaid
        /// dutp
        /// 22/7/20
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public GetListScheduleUnpaid getListScheduleUnpaid(InputGetDetailPaymentInsert input)
        {
            try
            {
                SqlParameter[] prms = new SqlParameter[]
                {
                    new SqlParameter {
                        ParameterName = "insuranceContractNo", DbType = DbType.String, Value = string.IsNullOrEmpty(input.insuranceContractNo) ? (object)DBNull.Value : input.insuranceContractNo, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "userId", DbType = DbType.String, Value = string.IsNullOrEmpty(input.userId) ? (object)DBNull.Value : input.userId, Size = Int32.MaxValue
                    },

                    new SqlParameter {
                        ParameterName = "resultMessage", DbType = DbType.String, Direction = ParameterDirection.Output, Size = Int32.MaxValue
                    },
                    new SqlParameter {
                        ParameterName = "resultCode", DbType = DbType.Int32, Direction = ParameterDirection.Output, Size = Int32.MaxValue
                    }
                };
                var resultObject = new GetListScheduleUnpaid();
                var result       = _Repository.ExecWithStoreProcedureCommand(Store_getListScheduleUnpaid, prms);
                if (result.errorCode == 0)
                {
                    resultObject = JsonConvert.DeserializeObject <GetListScheduleUnpaid>(result.errorMessage);
                }
                return(resultObject);
            }
            catch (Exception ex)
            {
                HDBH.Log.WriteLog.Error("PaymentService => getListScheduleUnpaid", ex);
                return(new GetListScheduleUnpaid());
            }
        }
コード例 #2
0
        public ActionResult CreateRepayment(InputGetDetailPaymentInsert input)
        {
            #region Code rule
            ///Nếu code == 0
            ///=> Thêm mới phiếu thu hoàn toàn
            ///Nếu code == 1
            ///=> Thêm mới phiếu thu từ hợp đồng đã có
            #endregion
            InsertModelView       model  = new InsertModelView();
            GetListScheduleUnpaid result = new GetListScheduleUnpaid();
            if (input.code == 1)
            {
                input.userId = RDAuthorize.UserId;
                result       = _paymentservice.getListScheduleUnpaid(input);
                if (result != null)
                {
                    Library.TransferData(result, ref model);
                }
            }
            List <AttachmentViewModel> fileList = new List <AttachmentViewModel>();
            ViewBag.fileList = fileList;

            List <SchedulePaymentDetailItemViewModel> paymentList = new List <SchedulePaymentDetailItemViewModel>();
            ViewBag.lstPayment = paymentList;


            model.viewMode = "CREATE";
            return(View(model));
        }