private void sbtnNew_Click(object sender, EventArgs e) { Program.eButton = Program.Button.New; oPara = new Account.Common.Entities.Parameter_Info(); Clear(); Enable(true); }
private void Detail_Para(Account.Common.Entities.Parameter_Info oCurPara) { if (gridView1.FocusedRowHandle < 0 || oCurPara == null) { return; } else { txtName.Text = oCurPara.Name; txtValue.Text = oCurPara.Value; mEditDescript.Text = oCurPara.Descript; } }
private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (gridView1.FocusedRowHandle < 0) { return; } else { string Name = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gcolName).ToString(); for (int i = 0; i < lstParameter.Count; i++) { if (lstParameter[i].Name == Name) { oSelectedPara = lstParameter[i]; break; } } Detail_Para(oSelectedPara); } }
private void Save_Para() { if (CheckValue() == false) { return; } if (oPara == null) { oPara = new Account.Common.Entities.Parameter_Info(); } oPara.Name = txtName.Text.Trim(); oPara.Value = txtValue.Text; oPara.Descript = mEditDescript.Text.Trim(); try { if (Program.eButton == Program.Button.New) { Insert_Parameter(); } else if (Program.eButton == Program.Button.Edit) { Update_Parameter(); } else if (Program.eButton == Program.Button.Del) { Delete_Parameter(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void sbtnDel_Click(object sender, EventArgs e) { Program.eButton = Program.Button.Del; txtName.Focus(); oPara = oSelectedPara; }