/// <summary> /// code to insert into Payment plans... /// </summary> /// <param name="planmstr"></param> /// <returns></returns> public static int PaymentPlans(tblPlansMaster planmstr) { try { using (var objdata = new HavanadataclassesDataContext()) { planmstr.Crdt = DateTime.Now; planmstr.Updt = DateTime.Now; planmstr.IsActive = true; objdata.tblPlansMasters.InsertOnSubmit(planmstr); objdata.SubmitChanges(); return(1); } } catch (Exception ex) { throw ex; } }
/// <summary> /// code to edit plans... /// </summary> /// <param name="ids"></param> /// <param name="nameOfPlan"></param> /// <returns></returns> public static int EditPlan(int ids, string nameOfPlan) { try { using (var objdata = new HavanadataclassesDataContext()) { tblPlansMaster objplanmaster = objdata.tblPlansMasters.Where(x => x.Id == ids).FirstOrDefault(); if (objplanmaster != null) { objplanmaster.PlanName = nameOfPlan; } objdata.SubmitChanges(); return(1); } } catch (Exception ex) { throw ex; } }
/// <summary> /// code to delete plans /// </summary> /// <param name="ids"></param> /// <returns></returns> public static int DeletePlan(int ids) { try { using (var objdata = new HavanadataclassesDataContext()) { tblPlansMaster objplanmmaster = objdata.tblPlansMasters.Where(x => x.Id == ids).FirstOrDefault(); if (objplanmmaster != null) { objplanmmaster.IsActive = false; } objdata.SubmitChanges(); return(1); } } catch (Exception ex) { throw ex; } }