public int InsertPaymentMaturity(PaymentsMaturity thePaymentsMaturity)
        {
            int ReturnValue = 0;

            using (SqlCommand InsertCommand = new SqlCommand())
            {
                InsertCommand.CommandType = CommandType.StoredProcedure;
                InsertCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                InsertCommand.Parameters.Add(GetParameter("@CustomerAccountID", SqlDbType.Int, thePaymentsMaturity.CustomerAccountID));
                InsertCommand.Parameters.Add(GetParameter("@MaturityDate", SqlDbType.VarChar, thePaymentsMaturity.MaturityDate));
                InsertCommand.Parameters.Add(GetParameter("@MaturityPaymentDate", SqlDbType.VarChar, thePaymentsMaturity.MaturityPaymentDate));
                InsertCommand.Parameters.Add(GetParameter("@MaturityPrincipalPayable", SqlDbType.Decimal, thePaymentsMaturity.MaturityPrincipalPayable));
                InsertCommand.Parameters.Add(GetParameter("@MaturityPrincipalPaid", SqlDbType.Decimal, thePaymentsMaturity.MaturityPrincipalPaid));
                InsertCommand.Parameters.Add(GetParameter("@MaturityInterestPayable", SqlDbType.Decimal, thePaymentsMaturity.MaturityInterestPayable));
                InsertCommand.Parameters.Add(GetParameter("@MaturityInterestPaid", SqlDbType.Decimal, thePaymentsMaturity.MaturityInterestPaid));
                InsertCommand.Parameters.Add(GetParameter("@MaturityBonusPayable", SqlDbType.Decimal, thePaymentsMaturity.MaturityBonusPayable));
                InsertCommand.Parameters.Add(GetParameter("@MaturityBonusPaid", SqlDbType.Decimal, thePaymentsMaturity.MaturityBonusPaid));
                InsertCommand.Parameters.Add(GetParameter("@MaturityPrincipalDeductions", SqlDbType.Decimal, thePaymentsMaturity.MaturityPrincipalDeductions));
                InsertCommand.Parameters.Add(GetParameter("@MaturityPrincipalDeductionsRemarks", SqlDbType.VarChar, thePaymentsMaturity.MaturityPrincipalDeductionsRemarks));
                InsertCommand.Parameters.Add(GetParameter("@MaturityTotalPayable", SqlDbType.Decimal, thePaymentsMaturity.MaturityTotalPayable));
                InsertCommand.Parameters.Add(GetParameter("@MaturityTotalPaid", SqlDbType.Decimal, thePaymentsMaturity.MaturityTotalPaid));
                InsertCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.OfficeID));
                InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                InsertCommand.CommandText = "pCRM_Maturities_Insert";

                ExecuteStoredProcedure(InsertCommand);

                ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString());

                return(ReturnValue);
            }
        }
        public static List <PaymentsMaturity> GetMaturityPaymentList(bool allOffices = false, bool showDeleted = false)
        {
            List <PaymentsMaturity> MaturityPaymentList = new List <PaymentsMaturity>();
            DataTable MaturityPaymentTable = PaymentsMaturityDataAccess.GetInstance.GetMaturityPaymentList(allOffices, showDeleted);

            foreach (DataRow dr in MaturityPaymentTable.Rows)
            {
                PaymentsMaturity TheMaturityPayment = DataRowToObject(dr);

                MaturityPaymentList.Add(TheMaturityPayment);
            }

            return(MaturityPaymentList);
        }
        public static List <PaymentsMaturity> GetMaturityPaymentList(DateTime maturityPaymentDate, bool allOffices = false, bool showDeleted = false)
        {
            List <PaymentsMaturity> TheMaturityPaymentList = GetMaturityPaymentList(allOffices, showDeleted);

            if (TheMaturityPaymentList.Count > 0)
            {
                var MaturityPaymentList = (from MaturityPayments in TheMaturityPaymentList
                                           where DateTime.Parse(MaturityPayments.MaturityPaymentDate) == maturityPaymentDate
                                           select MaturityPayments).ToList();

                foreach (PaymentsMaturity TheMaturityPayments in MaturityPaymentList)
                {
                    PaymentsMaturity ThePaymentsMaturity = (PaymentsMaturity)TheMaturityPayments;

                    TheMaturityPaymentList.Add(ThePaymentsMaturity);
                }
            }

            return(TheMaturityPaymentList);
        }
        public static PaymentsMaturity DataRowToObject(DataRow dr)
        {
            PaymentsMaturity TheMaturityPayment = new PaymentsMaturity
            {
                MaturityID                         = int.Parse(dr["MaturityID"].ToString()),
                CustomerAccountID                  = int.Parse(dr["CustomerAccountID"].ToString()),
                MaturityFormNumber                 = dr["MaturityFormNumber"].ToString(),
                MaturityDate                       = DateTime.Parse(dr["MaturityDate"].ToString()).ToString(MicroConstants.DateFormat),
                MaturityPaymentDate                = DateTime.Parse(dr["MaturityPaymentDate"].ToString()).ToString(MicroConstants.DateFormat),
                MaturityPrincipalPayable           = decimal.Parse(dr["MaturityPrincipalPayable"].ToString()),
                MaturityPrincipalPaid              = decimal.Parse(dr["MaturityPrincipalPaid"].ToString()),
                MaturityInterestPayable            = decimal.Parse(dr["MaturityInterestPayable"].ToString()),
                MaturityInterestPaid               = decimal.Parse(dr["MaturityInterestPaid"].ToString()),
                MaturityBonusPayable               = decimal.Parse(dr["MaturityBonusPayable"].ToString()),
                MaturityBonusPaid                  = decimal.Parse(dr["MaturityBonusPaid"].ToString()),
                MaturityPrincipalDeductions        = decimal.Parse(dr["MaturityPrincipalDeductions"].ToString()),
                MaturityPrincipalDeductionsRemarks = dr["MaturityPrincipalDeductionsRemarks"].ToString(),
                MaturityTotalPayable               = decimal.Parse(dr["MaturityTotalPayable"].ToString()),
                MaturityTotalPaid                  = decimal.Parse(dr["MaturityTotalPaid"].ToString()),
            };

            return(TheMaturityPayment);
        }
示例#5
0
 public int InsertPaymentMaturity(PaymentsMaturity thePaymentsMaturity)
 {
     return(PaymentsMaturityIntegration.InsertPaymentMaturity(thePaymentsMaturity));
 }
 public static int InsertPaymentMaturity(PaymentsMaturity thePaymentsMaturity)
 {
     return(PaymentsMaturityDataAccess.GetInstance.InsertPaymentMaturity(thePaymentsMaturity));
 }