void Customer_Insert() { try { frmCreate_Customer _frmCreate_Customer = new frmCreate_Customer(); _frmCreate_Customer.c_type = Convert.ToInt16(Form_Type.Insert); _frmCreate_Customer.Owner = Window.GetWindow(this); _frmCreate_Customer.ShowDialog(); if (_frmCreate_Customer.c_id_insert != 0) { LoadData(); for (int i = 0; i < c_lst.Count; i++) { Customer_Info ui = (Customer_Info)c_lst[i]; if (ui.Customer_Id == _frmCreate_Customer.c_id_insert) { c_row_select = i; _frmCreate_Customer.c_id_insert = 0; break; } } } DataGridHelper.NVSFocus(dgrCustomer, c_row_select, 0); } catch (Exception ex) { CommonData.log.Error(ex.ToString()); } }
void Customer_Update() { c_row_select = dgrCustomer.SelectedIndex; Customer_Info _Customer_Info = (Customer_Info)dgrCustomer.SelectedItem; if (_Customer_Info == null) { return; } frmCreate_Customer _frmCreate_Customer = new frmCreate_Customer(); _frmCreate_Customer.c_type = Convert.ToInt16(Form_Type.Update); _frmCreate_Customer.c_Customer_Info = _Customer_Info; _frmCreate_Customer.Owner = Window.GetWindow(this); _frmCreate_Customer.ShowDialog(); if (_frmCreate_Customer.c_id_insert != 0) { LoadData(); } DataGridHelper.NVSFocus(dgrCustomer, c_row_select, 0); }