private void btnCategorySave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (obj == null) { obj = new Model.CATEGORY(); obj.CATEGORY_NAME = edtCategoryName.Text; obj.DESCRIPTION = edtCategoryDescription.Text; obj.RECORD_STATUS = "A"; preCategory.saveCategory(obj); } else { obj.CATEGORY_NAME = edtCategoryName.Text; obj.DESCRIPTION = edtCategoryDescription.Text; obj.RECORD_STATUS = "A"; preCategory.updateCategory(obj); } this.beforeForm.WindowState = FormWindowState.Maximized; this.beforeForm.Activate(); //Close(); }
public frmAddCategory(CategoryPresenter preCategory, Model.CATEGORY obj) { this.preCategory = preCategory; this.obj = obj; InitializeComponent(); edtCategoryName.Text = obj.CATEGORY_NAME; edtCategoryDescription.Text = obj.DESCRIPTION; }
private void btnEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { GridView gridView = gridCategory.FocusedView as GridView; Model.CATEGORY obj = new Model.CATEGORY(); obj.CATEGORY_ID = Convert.ToInt32(gridView.GetFocusedRowCellValue("CATEGORY_ID").ToString()); obj.CATEGORY_NAME = gridView.GetFocusedRowCellValue("CATEGORY_NAME").ToString(); obj.DESCRIPTION = gridView.GetFocusedRowCellValue("DESCRIPTION").ToString(); frmAddCategory frmAdd = new frmAddCategory(preCategory, obj); frmAdd.ShowDialog(); }
private void btnEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { GridView gridView = gridCategory.FocusedView as GridView; Model.CATEGORY obj = new Model.CATEGORY(); obj.CATEGORY_ID = Convert.ToInt32(gridView.GetFocusedRowCellValue("CATEGORY_ID").ToString()); obj.CATEGORY_NAME = gridView.GetFocusedRowCellValue("CATEGORY_NAME").ToString(); obj.DESCRIPTION = gridView.GetFocusedRowCellValue("DESCRIPTION").ToString(); //frmAddCategory frmAdd = new frmAddCategory(preCategory, obj); //frmAdd.ShowDialog(); Form frmAdd = new frmAddCategory(preCategory, obj, this); frmAdd.WindowState = FormWindowState.Maximized; frmAdd.FormBorderStyle = FormBorderStyle.None; frmAdd.MdiParent = this.MdiParent; frmAdd.Dock = DockStyle.Fill; frmAdd.Show(); }
private void btnCategorySave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (obj == null) { obj = new Model.CATEGORY(); obj.CATEGORY_NAME = edtCategoryName.Text; obj.DESCRIPTION = edtCategoryDescription.Text; obj.RECORD_STATUS = "A"; preCategory.saveCategory(obj); } else { obj.CATEGORY_NAME = edtCategoryName.Text; obj.DESCRIPTION = edtCategoryDescription.Text; obj.RECORD_STATUS = "A"; preCategory.updateCategory(obj); } Close(); }