private void UpdateSubjectInTable(TextBoxSubject subjectBox) { var updateRow = m_table.Where(row => row.RowState != DataRowState.Deleted && row.subject_id == subjectBox.SubjectID).First(); updateRow.subject_name = subjectBox.SubjectName; }
protected void Page_Load(object sender, EventArgs e) { this.communicationId = Common.GetEncryptedQueryStringValue("communicationId", 0); LabelPageTitle.Text = (this.communicationId == 0) ? "New Communication" : "Edit Communication"; PanelError.Visible = false; Page.Form.DefaultFocus = TextBoxSubject.ClientID; Page.Form.DefaultButton = ButtonSaveList.UniqueID; if (!IsPostBack) { TextBoxSubject.Focus(); BindCommunication(); ButtonSaveNew.Visible = true; if (ViewState["communicationId"] != null) { this.communicationId = Convert.ToInt32(ViewState["communicationId"].ToString()); } if (this.communicationId != 0) { BindCommunication(); } } }
private TextBoxSubject AddSubject() { TextBoxSubject temp = new TextBoxSubject(); temp.SubjectID = -1; temp.IsChanged = false; m_listSubjects.Add(temp); return(temp); }
private void InitList() { m_listSubjects = new ListContainer <TextBoxSubject>(); int height = new TextBoxSubject().Height; Controls.Add(m_listSubjects); m_listSubjects.Init(height + 2, new Point(0, 0), "m_listSubjects", new Size(ClientSize.Width, ClientSize.Height - m_panelButtons.Height), 3, 5); m_listSubjects.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; }