Beispiel #1
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            var client         = _clientService.GetByName(treeViewClients.SelectedNode.Text);
            var editClientForm = new EditClientForm(client);

            editClientForm.ShowDialog();
            MainFormUtils.SetRoot(treeViewClients, _clientService.GetRootClients());
        }
        private static void ClientsForm_OnEditClientButtonClick(object sender, EditClientArgs e)
        {
            EditForm = new EditClientForm();
            EditForm.SaveButtonClick += UpdateClient;

            int clientId = int.Parse(e.SelectedItem.Text);

            using (var db = DBHelper.GetConnection())
            {
                EditForm.FillForm(db.Find <Client>(clientId));
            }
            EditForm.ShowDialog();
        }
Beispiel #3
0
 private void EditMainClientbutton_Click(object sender, EventArgs e)
 {
     if (MainClientsdataGridView.SelectedRows.Count > 0 && MainClientsdataGridView.SelectedRows.Count < 2)
     {
         int            clientid       = int.Parse(MainClientsdataGridView.SelectedRows[0].Cells[0].Value.ToString());
         EditClientForm editClientForm = new EditClientForm(clientid);
         editClientForm.FormClosed += closed;
         editClientForm.ShowDialog();
     }
     else
     {
         MessageBox.Show(" اختر العميل المراد تعديله فقط", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Beispiel #4
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            if (ClientDataGrid.SelectedRows.Count > 0)
            {
                EditClientForm edit = new EditClientForm(this);

                edit.txtId.Text        = ClientDataGrid.CurrentRow.Cells[0].Value.ToString();
                edit.txtName.Text      = ClientDataGrid.CurrentRow.Cells[1].Value.ToString();
                edit.txtlastname.Text  = ClientDataGrid.CurrentRow.Cells[2].Value.ToString();
                edit.txtnumtarj.Text   = ClientDataGrid.CurrentRow.Cells[3].Value.ToString();
                edit.txtLimit.Text     = ClientDataGrid.CurrentRow.Cells[4].Value.ToString();
                edit.cbtypeperson.Text = ClientDataGrid.CurrentRow.Cells[5].Value.ToString();
                edit.rdstatus.Checked  = Convert.ToBoolean(ClientDataGrid.CurrentRow.Cells[6].Value.ToString());

                edit.Show();
            }
            else
            {
                MessageBox.Show("Debe de seleccionar el campo que quiere editar", "Seleccionar?", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        /// <summary>
        /// Открытие формы с передачей объекта типа Client
        /// </summary>
        private void butEditClient_Click()
        {
            Client client = _mainView.SelectedClient;

            var main       = Application.OpenForms.OfType <XtraForm>().First(f => f.Name.Equals("MainForm"));
            var clientEdit = new EditClientForm();

            clientEdit.Owner         = main;
            clientEdit.StartPosition = FormStartPosition.CenterParent;

            clientEdit.Client = client;

            clientEdit.txtClientEditCode.Text = client.Client_Code.ToString();
            clientEdit.txtClientEditName.Text = client.Client_Name;

            cities._cities.ForEach(c => clientEdit.cmbEditCities.Items.Add(c));
            clientEdit.cmbEditCities.SelectedItem = client.Client_City;

            var clientEditPresenter = new EditClientFormPresenter(clientEdit);

            clientEdit.ShowDialog();
        }