Ejemplo n.º 1
0
        public static CustomerLoanReceipt DataRowToObject(DataRow dr)
        {
            CustomerLoanReceipt TheCustomerLoanReceipt = new CustomerLoanReceipt
            {
                CustomerLoanReceiptID     = int.Parse(dr["CustomerLoanReceiptID"].ToString()),
                ReceiptSeries             = dr["ReceiptSeries"].ToString(),
                CustomerLoanReceiptNumber = dr["CustomerLoanReceiptNumber"].ToString(),
                CustomerLoanID            = int.Parse(dr["CustomerLoanID"].ToString()),
                CustomerLoanCode          = dr["CustomerLoanCode"].ToString(),
                LoanApplicationNumber     = dr["LoanApplicationNumber"].ToString(),
                LoanApplicationDate       = DateTime.Parse(dr["LoanApplicationDate"].ToString()).ToString(MicroConstants.DateFormat),
                LoanAmount            = decimal.Parse(dr["LoanAmount"].ToString()),
                RateOfInterest        = decimal.Parse(dr["RateOfInterest"].ToString()),
                CustomerID            = int.Parse(dr["CustomerID"].ToString()),
                CustomerCode          = dr["CustomerCode"].ToString(),
                CustomerName          = dr["CustomerName"].ToString(),
                CustomerAccountID     = int.Parse(dr["CustomerAccountID"].ToString()),
                CustomerAccountCode   = dr["CustomerAccountCode"].ToString(),
                DateOfRecovery        = DateTime.Parse(dr["DateOfRecovery"].ToString()).ToString(MicroConstants.DateFormat),
                AmountPaid            = decimal.Parse(dr["AmountPaid"].ToString()),
                AmountPaidAsPrincipal = decimal.Parse(dr["AmountPaidAsPrincipal"].ToString()),
                AmountPaidAsInterest  = decimal.Parse(dr["AmountPaidAsInterest"].ToString()),
                InstallmentNumber     = int.Parse(dr["InstallmentNumber"].ToString()),
                Remark      = dr["Remark"].ToString(),
                IsCancelled = bool.Parse(dr["IsCancelled"].ToString()),
                OfficeID    = int.Parse(dr["OfficeID"].ToString()),
                OfficeName  = dr["OfficeName"].ToString()
            };

            return(TheCustomerLoanReceipt);
        }
Ejemplo n.º 2
0
        public static CustomerLoanReceipt GetCustomerLoanReceiptByID(int loanReceiptID)
        {
            DataRow CustomerLoanReceiptRow = CustomerLoanReceiptDataAccess.GetInstance.GetCustomerLoanReceiptByID(loanReceiptID);

            CustomerLoanReceipt TheCustomerLoanReceipt = DataRowToObject(CustomerLoanReceiptRow);

            return(TheCustomerLoanReceipt);
        }
Ejemplo n.º 3
0
        public static List <CustomerLoanReceipt> GetCustomerLoanReceiptListByCustomerLoanID(int customerLoanID)
        {
            List <CustomerLoanReceipt> CustomerLoanReceiptList = new List <CustomerLoanReceipt>();
            DataTable CustomerLoanReceiptTable = CustomerLoanReceiptDataAccess.GetInstance.GetCustomerLoanReceiptListByCustomerLoanID(customerLoanID);

            foreach (DataRow dr in CustomerLoanReceiptTable.Rows)
            {
                CustomerLoanReceipt TheCustomerLoanReceipt = DataRowToObject(dr);

                CustomerLoanReceiptList.Add(TheCustomerLoanReceipt);
            }

            return(CustomerLoanReceiptList);
        }
        public int InsertCustomerLoanReceipt(CustomerLoanReceipt theCustomerLoanReceipt)
        {
            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("@ReceiptSeries", SqlDbType.VarChar, theCustomerLoanReceipt.ReceiptSeries));
                InsertCommand.Parameters.Add(GetParameter("@CustomerLoanID", SqlDbType.Int, theCustomerLoanReceipt.CustomerLoanID));
                InsertCommand.Parameters.Add(GetParameter("@DateOfRecovery", SqlDbType.VarChar, theCustomerLoanReceipt.DateOfRecovery));
                InsertCommand.Parameters.Add(GetParameter("@AmountPaid", SqlDbType.Decimal, theCustomerLoanReceipt.AmountPaid));
                InsertCommand.Parameters.Add(GetParameter("@AmountPaidAsPrincipal", SqlDbType.Decimal, theCustomerLoanReceipt.AmountPaidAsPrincipal));
                InsertCommand.Parameters.Add(GetParameter("@AmountPaidAsInterest", SqlDbType.Decimal, theCustomerLoanReceipt.AmountPaidAsInterest));
                InsertCommand.Parameters.Add(GetParameter("@InstallmentNumber", SqlDbType.Int, theCustomerLoanReceipt.InstallmentNumber));
                InsertCommand.Parameters.Add(GetParameter("@Remark", SqlDbType.VarChar, theCustomerLoanReceipt.Remark));
                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_CustomerLoanReceipts_Insert";
                ExecuteStoredProcedure(InsertCommand);
                ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString());
                return(ReturnValue);
            }
        }
Ejemplo n.º 5
0
 public int InsertCustomerLoanReceipt(CustomerLoanReceipt theCustomerLoanReceipt)
 {
     return(CustomerLoanReceiptIntegration.InsertCustomerLoanReceipt(theCustomerLoanReceipt));
 }
Ejemplo n.º 6
0
 public static int InsertCustomerLoanReceipt(CustomerLoanReceipt theCustomerLoanReceipt)
 {
     return(CustomerLoanReceiptDataAccess.GetInstance.InsertCustomerLoanReceipt(theCustomerLoanReceipt));
 }