/// <summary> /// Handles Click event for cmdUpdate button /// </summary> /// <param name='sender'> /// Sender. /// </param> /// <param name='e'> /// Event args. /// </param> protected void cmdUpdate_Click(object sender, EventArgs e) { try { var ctrl = new DocumRollerController (); DocumRollerInfo item; // determine if we are adding or updating // ALT: if (Null.IsNull (itemId)) if (!itemId.HasValue) { // TODO: populate new object properties with data from controls // to add new record item = new DocumRollerInfo (); item.Content = txtContent.Text; item.ModuleID = this.ModuleId; ctrl.Add<DocumRollerInfo> (item); } else { // TODO: update properties of existing object with data from controls // to update existing record item = ctrl.Get<DocumRollerInfo> (itemId.Value, this.ModuleId); item.Content = txtContent.Text; ctrl.Update<DocumRollerInfo> (item); } Response.Redirect (Globals.NavigateURL (), true); } catch (Exception ex) { Exceptions.ProcessModuleLoadException (this, ex); } }