示例#1
0
 /// <summary>
 /// code to edit plan details...
 /// </summary>
 /// <param name="ids"></param>
 /// <param name="emi"></param>
 /// <param name="totalEmi"></param>
 /// <returns></returns>
 public static int EditPlansDetails(int ids, int planname, decimal totalEmi, decimal emi, decimal tax, decimal taxedamount, decimal monthlyamount, decimal totalamount, decimal price)
 {
     try
     {
         using (var objdata = new HavanadataclassesDataContext())
         {
             tblPlanCharge plnchrge = objdata.tblPlanCharges.Where(x => x.Id == ids).FirstOrDefault();
             if (plnchrge != null)
             {
                 plnchrge.PlanId         = Convert.ToInt32(planname);
                 plnchrge.EMI            = emi;
                 plnchrge.Total_EMI      = totalEmi;
                 plnchrge.Tax            = tax;
                 plnchrge.Taxed_Amount   = taxedamount;
                 plnchrge.Monthly_Amount = monthlyamount;
                 plnchrge.Total_Amount   = totalamount;
                 plnchrge.Price          = price;
             }
             objdata.SubmitChanges();
             return(1);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#2
0
 /// <summary>
 /// code to insert plan details.....
 /// </summary>
 /// <param name="plancharges"></param>
 /// <returns></returns>
 public static int PaymentPlansDetails(tblPlanCharge plancharges)
 {
     try
     {
         using (var objdata = new HavanadataclassesDataContext())
         {
             plancharges.Crdt     = DateTime.Now;
             plancharges.Updt     = DateTime.Now;
             plancharges.IsActive = true;
             objdata.tblPlanCharges.InsertOnSubmit(plancharges);
             objdata.SubmitChanges();
             return(1);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
 /// <summary>
 /// code to delete plan details
 /// </summary>
 /// <param name="ids"></param>
 /// <returns></returns>
 public static int DeletePlanDetails(int ids)
 {
     try
     {
         using (var objdata = new HavanadataclassesDataContext())
         {
             tblPlanCharge objplancharge = objdata.tblPlanCharges.Where(x => x.Id == ids).FirstOrDefault();
             if (objplancharge != null)
             {
                 objplancharge.IsActive = false;
             }
             objdata.SubmitChanges();
             return(1);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#4
0
 /// <summary>
 /// code to edit plans details...
 /// </summary>
 /// <param name="ids"></param>
 /// <param name="nameOfPlan"></param>
 /// <returns></returns>
 public static int EditPlandetails(int ids, int _emi, int _totalEMIs, decimal _extracharges)
 {
     try
     {
         using (var objdata = new HavanadataclassesDataContext())
         {
             tblPlanCharge objplancharge = objdata.tblPlanCharges.Where(x => x.Id == ids).FirstOrDefault();
             if (objplancharge != null)
             {
                 objplancharge.EMI           = _emi;
                 objplancharge.Total_EMIs    = _totalEMIs;
                 objplancharge.Extra_Charges = _extracharges;
             }
             objdata.SubmitChanges();
             return(1);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }