Beispiel #1
0
        private void txtNamaVendor_Validating(object sender, CancelEventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = Class.clsVendor.DBSearch(txtNamaVendor.Text);
                if (dt != null && txtNamaVendor.Text.Trim().Length > 0 && txtNamaVendor.Text != _vendor.NamaVendor)
                {
                    switch (dt.Rows.Count)
                    {
                    case 0: break;

                    case 1:
                    {
                        _vendor.SetFromDataRow(dt.Rows[0]);
                        RefreshData();
                    } break;

                    default:
                        ShowFormDialog(dt);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }