private void NewItem(object sender, EventArgs e)
 {
     var newCustomer = new CustomerForm(_currentUser);
     var result = newCustomer.ShowDialog();
     if (result == DialogResult.OK)
     {
         RefreshItems(sender, e);
     }
 }
        private void UpdateItem(object sender, EventArgs e)
        {
            var user = radGridView.SelectedRows[0].DataBoundItem as Customer;

            var newCustomer = new CustomerForm(user.Id, _currentUser);
            var result = newCustomer.ShowDialog();
            if (result == DialogResult.OK)
            {
                RefreshItems(sender, e);
            }
        }
Exemple #3
0
        private void CellDoubleClick(object sender, GridViewCellEventArgs e)
        {
            if (e.RowIndex == -1) return;

            var template = e.Column.OwnerTemplate;
            if (template is MasterGridViewTemplate)
            {
                return;
            }
            else
            {
                if (isLeftClick == 1 && e.ColumnIndex == 2)
                {
                    var order = e.Row.DataBoundItem as OrderTemplate;
                    if (order != null)
                    {
                        selectedId = order.CustomerId;
                    }

                    var newCustomer = new CustomerForm(selectedId, currentUser) { Dock = DockStyle.Fill, MaximizeBox = true };
                    newCustomer.ShowDialog();
                    RefreshItems(sender, e);
                }
            }
        }