private void main_ultraGrid_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { int detailID = (int)e.Cell.Row.Cells[Form_task21_sec.ID_colName].Value; if (e.Cell.Value.Equals(Form_task21_sec.edit_colName)) { Form_task21_detail detailForm = new Form_task21_detail(this.secID, detailID); this.Pop_detailForm(detailForm); } else if (e.Cell.Value.Equals(Form_task21_sec.del_colName)) { if (MessageBox.Show("Are you sure to Delete Task " + detailID + "?", "Msg", MessageBoxButtons.OKCancel) == DialogResult.OK) { Task21_security detail = new Task21_security(detailID); if (detail == null) { return; } detail.Delete_from_DB(); Task21_secMaster.Reset(); this.Refresh_parentUI(); this.BindData(); } } }
private void save_button_Click(object sender, EventArgs e) { Task21_security detail = new Task21_security(this.DetailID); bool existFlag = detail.Init_from_DB(); if (!existFlag) { detail = new Task21_security(); detail.SecurityID.Value = this.SecurityID; } detail.TaskName.Value = this.taskName_textBox.Text; detail.Status.Value = Helper_hssStatus.Str_to_Status(this.status_comboBox.Text).ToString(); bool successFlag = false; if (existFlag) { successFlag = detail.Update_to_DB(); } else { successFlag = detail.Insert_to_DB(); } if (successFlag) { Task21_secMaster.Reset(); this.Refresh_UI(); } this.Close(); }
private void BindData() { this.main_dt.Clear(); foreach (Task21_security td in Task21_secMaster.Get_secList(this.secID)) { DataRow row = this.main_dt.Rows.Add(); row[Form_task21_sec.ID_colName] = td.ID; row[Form_task21_sec.taskName_colName] = td.TaskName.Value; row[Form_task21_sec.status_colName] = td.Status.Value; } }