protected void btnDelete_Click(object sender, EventArgs e) { var msg = Plan_DAL.Delete(Convert.ToInt32(ViewState["Plan_id"])); if (msg) { Label1.Text = "Plan Has Been Deleted Successfully!"; } else { Label1.Text = "Error to delete -> " + msg; } BindData(); udp.Update(); }
public bool Insert(PlanModel o) { bool result = false; if (o == null) { return(result); } else { //todo Apply my business logic if any or call DAL. if (string.IsNullOrEmpty(o.PlanName) || o.PlanName.Length <= 1) { return(result); } else { return(result = Plan_DAL.Insert(o)); } } }
public IEnumerable <PlanModel> Get() { return(Plan_DAL.GetAll()); }
public IEnumerable <PlanModel> Get(int id) { return(Plan_DAL.GetAll().Where(s => s.PlanId == id)); }
public bool Update(PlanModel o) { return(Plan_DAL.Update(o)); }
public bool Delete(int id) { return(Plan_DAL.Delete(id)); }