Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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));
                }
            }
        }
Esempio n. 3
0
 public IEnumerable <PlanModel> Get()
 {
     return(Plan_DAL.GetAll());
 }
Esempio n. 4
0
 public IEnumerable <PlanModel> Get(int id)
 {
     return(Plan_DAL.GetAll().Where(s => s.PlanId == id));
 }
Esempio n. 5
0
 public bool Update(PlanModel o)
 {
     return(Plan_DAL.Update(o));
 }
Esempio n. 6
0
 public bool Delete(int id)
 {
     return(Plan_DAL.Delete(id));
 }