public int InsertMISPayment(MISPayment thePaymentsMISInterest) { 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, thePaymentsMISInterest.CustomerAccountID)); InsertCommand.Parameters.Add(GetParameter("@MISFirstDueDate", SqlDbType.VarChar, thePaymentsMISInterest.MISFirstDueDate)); InsertCommand.Parameters.Add(GetParameter("@MISLastDueDate", SqlDbType.VarChar, thePaymentsMISInterest.MISLastDueDate)); InsertCommand.Parameters.Add(GetParameter("@MISNumberFrom", SqlDbType.Int, thePaymentsMISInterest.MISNumberFrom)); InsertCommand.Parameters.Add(GetParameter("@MISNumberTo", SqlDbType.Int, thePaymentsMISInterest.MISNumberTo)); InsertCommand.Parameters.Add(GetParameter("@MISPayable", SqlDbType.Decimal, thePaymentsMISInterest.MISPayable)); InsertCommand.Parameters.Add(GetParameter("@MISPaymentDate", SqlDbType.VarChar, thePaymentsMISInterest.MISPaymentDate)); InsertCommand.Parameters.Add(GetParameter("@MISPaid", SqlDbType.Decimal, thePaymentsMISInterest.MISPaid)); InsertCommand.Parameters.Add(GetParameter("@MISPaymentMode", SqlDbType.VarChar, thePaymentsMISInterest.MISPaymentMode)); InsertCommand.Parameters.Add(GetParameter("@MISPaymentReference", SqlDbType.VarChar, thePaymentsMISInterest.MISPaymentReference)); InsertCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID)); InsertCommand.CommandText = "pCRM_MISPayments_Insert"; ExecuteStoredProcedure(InsertCommand); ReturnValue = int.Parse(InsertCommand.Parameters[0].Value.ToString()); return(ReturnValue); } }
public static MISPayment GetLastMISPayment(int customerAccountID) { MISPayment TheMISPayment = new MISPayment(); if (GetMISPaymentsByCustomerAccountID(customerAccountID).Count > 0) { var LastMISPayment = (from MISPaymentList in GetMISPaymentsByCustomerAccountID(customerAccountID) orderby DateTime.Parse(MISPaymentList.MISLastDueDate) descending select MISPaymentList).First(); TheMISPayment = (MISPayment)LastMISPayment; } return(TheMISPayment); }
public static List <MISPayment> GetMISPaymentsByCustomerAccountID(int customerAccountID) { List <MISPayment> MISPaymentList = new List <MISPayment>(); DataTable MISPaymentTable = new DataTable(); MISPaymentTable = MISPaymentDataAccess.GetInstance.GetMISPaymentsByCustomerAccountID(customerAccountID); foreach (DataRow dr in MISPaymentTable.Rows) { MISPayment TheMISPayment = DataRowToObject(dr); MISPaymentList.Add(TheMISPayment); } return(MISPaymentList); }
public static List <MISPayment> GetMISPaymentList(string searchText = "") { List <MISPayment> MISPaymentList = new List <MISPayment>(); DataTable MISPaymentTable = new DataTable(); MISPaymentTable = MISPaymentDataAccess.GetInstance.GetMISPaymentList(searchText); foreach (DataRow dr in MISPaymentTable.Rows) { MISPayment TheMISPayment = DataRowToObject(dr); MISPaymentList.Add(TheMISPayment); } return(MISPaymentList); }
public static MISPayment DataRowToObject(DataRow dr) { MISPayment TheMISPayment = new MISPayment(); TheMISPayment.MISPaymentID = int.Parse(dr["MISPaymentID"].ToString()); TheMISPayment.CustomerAccountID = int.Parse(dr["CustomerAccountID"].ToString()); TheMISPayment.CustomerName = dr["CustomerName"].ToString(); TheMISPayment.MISFirstDueDate = DateTime.Parse(dr["MISFirstDueDate"].ToString()).ToString(MicroConstants.DateFormat); TheMISPayment.MISLastDueDate = DateTime.Parse(dr["MISLastDueDate"].ToString()).ToString(MicroConstants.DateFormat); TheMISPayment.MISNumberFrom = int.Parse(dr["MISNumberFrom"].ToString()); TheMISPayment.MISNumberTo = int.Parse(dr["MISNumberTo"].ToString()); TheMISPayment.MISPayable = decimal.Parse(dr["MISPayable"].ToString()); TheMISPayment.MISPaymentDate = DateTime.Parse(dr["MISPaymentDate"].ToString()).ToString(MicroConstants.DateFormat); TheMISPayment.MISPaid = decimal.Parse(dr["MISPaid"].ToString()); TheMISPayment.MISPaymentMode = dr["MISPaymentMode"].ToString(); return(TheMISPayment); }
public int InsertMISInterestPayments(MISPayment theMISPayment) { return(MISPaymentIntegration.InsertMISPayment(theMISPayment)); }
public static int InsertMISPayment(MISPayment theMISPayment) { return(MISPaymentDataAccess.GetInstance.InsertMISPayment(theMISPayment)); }