protected void Page_Load(object sender, EventArgs e) { dataaccess da = new dataaccess(); bool cancel = new tools().SessionCheck(Session); if (cancel) { Response.Redirect("Default.aspx"); } this.SqlDataSourceRepeaterClasses.SelectParameters.Add("id", Session[constants.SESSION_PID].ToString()); _dataSetClasses = da.GetAllClasses(int.Parse(Session[constants.SESSION_PID].ToString())); switch (Session[constants.SESSION_MODE].ToString()) { case constants.SESSION_MODE_EDIT_CLASS: this.FormViewClass.ChangeMode(FormViewMode.Edit); _currentClassId = Session[constants.SESSION_MODE_EDIT_CID].ToString(); this.SqlDataSourceClass.UpdateParameters.Add("cid", _currentClassId); break; case constants.SESSION_MODE_VIEW: this.FormViewClass.ChangeMode(FormViewMode.ReadOnly); _currentClassId = Session[constants.SESSION_MODE_VIEW_ID].ToString(); break; default: case constants.SESSION_MODE_ADD: this.FormViewClass.ChangeMode(FormViewMode.Insert); break; } this.SqlDataSourceClass.SelectParameters.Add("cid", _currentClassId); }
protected void Page_Load(object sender, EventArgs e) { dataaccess da = new dataaccess(); bool cancel = new tools().SessionCheck(Session); if (cancel) { Response.Redirect("Default.aspx"); } this.SqlDataSourceRepeaterClasses.SelectParameters.Add("id", Session[constants.SESSION_PID].ToString()); _dataSetClasses = da.GetAllClasses(int.Parse(Session[constants.SESSION_PID].ToString())); }