public void UpdatePlan() { u.DietPlans = new DietPlanMapper().SelectUserDietPlans(u.Userid, Calendar.SelectedDate.Date); DietPlan.DataSource = u.DietPlans; DietPlan.DataValueField = "Dpid"; DietPlan.DataTextField = "Showcase"; Macros.Text = u.UserMakros(); DietPlan.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { int id = (int)Session["LoggedId"]; u = new UsersMapper().Select(id); if (!IsPostBack) { ConsumablesChoice.DataSource = new ConsumablesMapper().Select(); ConsumablesChoice.DataValueField = "Cid"; ConsumablesChoice.DataTextField = "Name"; ConsumablesChoice.DataBind(); u.DietPlans = new DietPlanMapper().SelectUserDietPlans(u.Userid, DateTime.Today.Date); //today DietPlan.DataSource = u.DietPlans; //DietPlan.DataValueField = "Value"; DietPlan.DataValueField = "Dpid"; DietPlan.DataTextField = "Showcase"; Macros.Text = u.UserMakros(); DietPlan.DataBind(); } }