protected void Page_Load(object sender, EventArgs e) { Master.PageHeader = "Assessment Group"; if (Request.QueryString["AGroupid"] != null) { GroupID = Convert.ToInt32(Request.QueryString["AGroupid"]); } if (!Page.IsPostBack) { if (GroupID > 0) { AssessmentGroup obj = new AssessmentGroup(GroupID, mCurrentUserID); LoadAssessmentGroup(obj); } } }
protected void lbSave_Click(object sender, EventArgs e) { AssessmentGroup obj = new AssessmentGroup(mCurrentUserID); if (ViewState["GroupId"] != null) { obj.ID = (int)ViewState["GroupId"]; } else { obj.ID = (GroupID > 0) ? GroupID : -1; } obj.Name = txtName.Text; obj.Description = txtDescription.Text; obj.Status = rblAGroupStatus.SelectedValue; obj.Save(); LoadAssessmentGroup(obj); ViewState["GroupId"] = obj.ID; }
private void LoadAssessmentGroup(AssessmentGroup obj) { txtName.Text = obj.Name; txtDescription.Text = obj.Description; rblAGroupStatus.SelectedValue = obj.Status; }