protected void plan_btn_Submit_Click(object sender, EventArgs e) { PlansMaster pm = new PlansMaster { PlanName = txt_planname.Text, PlanDescription = txt_plan_description.Text, Coverage1 = txt_coverage_one.Text, Coverage2 = txt_coverage_two.Text, Coverage3 = txt_coverage_three.Text, ValidityInYears = int.Parse(txt_validity.Text), PlanAmount = long.Parse(txt_plan_amount.Text), IsActive = true, }; PlansMaster cm = new PlansMaster { }; if (BAL.AdminOperations.Addplan(pm)) { string _msg = string.Format("SuccessFunction('{0}')", "Plan added successfully!"); Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", _msg, true); } else { string _msg = string.Format("ErrFunction('{0}')", "OOPS! Unable to add"); Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", _msg, true); } }
public static bool addplan(PlansMaster pm) { try { using (DBEntitiesDataContext db = new DBEntitiesDataContext()) { db.PlansMasters.InsertOnSubmit(pm); db.SubmitChanges(); } return(true); } catch (Exception ex) { return(false); } }
public static bool Addplan(PlansMaster pm) { return(DAL.AdminOperations.addplan(pm)); }