Exemplo n.º 1
0
 public int IndexOf(Plan plan)
 {
     return List.IndexOf(plan);
 }
Exemplo n.º 2
0
 public void Delete(Plan plan)
 {
     List.Remove(plan);
 }
Exemplo n.º 3
0
        public Plans GetPlans()
        {
            Plans plans = new Plans();
            try
            {
                using (SqlConnection conn = new SqlConnection(connString))
                using (SqlCommand comm = new SqlCommand("usp_GetInstalmentSchedules", conn))
                {
                    comm.CommandType = CommandType.StoredProcedure;

                    conn.Open();

                    using (SqlDataReader dr = comm.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Plan p = new Plan();
                            p.PlanID = dr["Plan ID"].ToString();
                            p.Description = dr["Description"].ToString();
                            p.NoOfPayments = Convert.ToInt32(dr["Number of Payments"].ToString());
                            p.DaysFromFirstPayment = Convert.ToInt32(dr["Days from first payment"].ToString());
                            p.Cadence = Convert.ToInt32(dr["Cadence"].ToString());

                            plans.Add(p);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                throw;
            }
            return plans;
        }
Exemplo n.º 4
0
 public void Add(Plan plan)
 {
     List.Add(plan);
 }
Exemplo n.º 5
0
        public Plan GetPlan(string planID)
        {
            Plan plan = new Plan();
            try
            {
                using (SqlConnection conn = new SqlConnection(connString))
                using (SqlCommand comm = new SqlCommand("usp_GetPlanDetails", conn))
                {
                    comm.CommandType = CommandType.StoredProcedure;

                    conn.Open();

                    comm.Parameters.Clear();
                    comm.Parameters.Add(new SqlParameter("@Plan_ID", planID));

                    using (SqlDataReader dr = comm.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            plan.PlanID = dr["Plan ID"].ToString();
                            plan.Description = dr["Description"].ToString();
                            plan.NoOfPayments = Convert.ToInt32(dr["Number of Payments"].ToString());
                            plan.DaysFromFirstPayment = Convert.ToInt32(dr["Days from first payment"].ToString());
                            plan.Cadence = Convert.ToInt32(dr["Cadence"].ToString());
                            plan.InstallmentFeePercentage =
                                Convert.ToDecimal(dr["Installment Fee Percentage"]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                throw;
            }
            return plan;
        }