Exemplo n.º 1
0
        /// <summary>
        /// New Item
        /// </summary>
        private void NewItemContacts()
        {
            frmEditContacts form = new frmEditContacts();
            var             res  = form.ShowDialog();       // Show Edit form

            while (res == DialogResult.Yes)                 // If New item request
            {
                form.Dispose();
                form = new frmEditContacts();               // New Form
                res  = form.ShowDialog();                   // Show new Edit form
            }
            UpdateConOLV();                                 // Update Contact OLV
        }
Exemplo n.º 2
0
 /// <summary>
 /// Edit Item
 /// </summary>
 private void EditItemContacts()
 {
     if (olvContacts.SelectedIndex >= 0)                 // If selected Item
     {
         frmEditContacts form = new frmEditContacts();   // Show Edit form
         var             res  = form.ShowDialog(((Contacts)olvContacts.SelectedObject).ID);
         while (res == DialogResult.Yes)                 // If New item request
         {
             form.Dispose();
             form = new frmEditContacts();               // New Form
             res  = form.ShowDialog();                   // Show new Edit form
         }
         UpdateConOLV();                                 // Update Contact OLV
     }
 }
Exemplo n.º 3
0
        private void btnAddPerson_Click(object sender, EventArgs e)
        {
            Guid            ID;
            frmEditContacts form = new frmEditContacts();

            form.ShowDialog(out ID);

            Contacts person = db.Contacts.Find(ID);

            if (person != null)
            {
                txtPerson.Text    = person.Name.Trim() + " " + person.Surname.Trim();
                PersonGuid        = ID;
                lblPersonNum.Text = Lng.Get("PersonNum", "Person number") + ": " + person.code.Trim();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Button add person
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddPerson_Click(object sender, EventArgs e)
        {
            databaseEntities db = new databaseEntities();

            // ----- Create new Contact -----
            Guid            ID;
            frmEditContacts form = new frmEditContacts();

            form.ShowDialog(out ID);

            // ----- Select this Contact -----
            Contacts person = db.Contacts.Find(ID);

            if (person != null)
            {
                txtPerson.Text    = person.Name.Trim() + " " + person.Surname.Trim();
                PersonGuid        = ID;
                lblPersonNum.Text = Lng.Get("PersonNum", "Person number") + ": " + person.PersonCode.Trim();
            }
        }