public static void NewItemByFolderClass(string sFolderClass, ExchangeService oExchangeService, FolderId oFolderId) { switch (sFolderClass) { case "IPF.Note": MessageForm oMessageForm = new MessageForm(oExchangeService, WellKnownFolderName.Drafts); oMessageForm.ShowDialog(); oMessageForm = null; break; case "IPF.Contact": ContactsForm oContactsFormForm = new ContactsForm(oExchangeService, oFolderId); oContactsFormForm.ShowDialog(); oContactsFormForm = null; break; case "IPF.Appointment": CalendarForm oCalendarFormForm = new CalendarForm(oExchangeService, oFolderId); oCalendarFormForm.ShowDialog(); oCalendarFormForm = null; break; case "IPF.Task": TaskForm oTaskFormForm = new TaskForm(oExchangeService, oFolderId); oTaskFormForm.ShowDialog(); oTaskFormForm = null; break; } }
public async Task <ActionResult <Contact> > PostContact(ContactsForm contact) { var result = await _contactsService.PostContactAsync(contact); if (result) { return(Ok()); } return(Problem()); }
public async Task <IActionResult> PutContact(ContactsForm contact) { bool result = await _contactsService.PutContactAsync(contact); if (result) { return(Ok()); } return(BadRequest()); }
//[DirectMethod] //public void DeleteSkill(string index) //{ // try // { // //Step 1 Code to delete the object from the database // EmployeeContact n = new EmployeeContact(); // n.recordId = index; // n.rtId = 0; // n.employeeId = Convert.ToInt32(CurrentEmployee.Text); // n.cellPhone = ""; // n.email = ""; // n.homePhone = ""; // n.workPhone = ""; // PostRequest<EmployeeContact> req = new PostRequest<EmployeeContact>(); // req.entity = n; // PostResponse<EmployeeContact> res = _employeeService.ChildDelete<EmployeeContact>(req); // if (!res.Success) // { // //Show an error saving... // X.MessageBox.ButtonText.Ok = Resources.Common.Ok; // X.Msg.Alert(Resources.Common.Error, res.Summary).Show(); // return; // } // else // { // //Step 2 : remove the object from the store // contactStore.Remove(index); // //Step 3 : Showing a notification for the user // Notification.Show(new NotificationConfig // { // Title = Resources.Common.Notification, // Icon = Icon.Information, // Html = Resources.Common.RecordDeletedSucc // }); // } // } // catch (Exception ex) // { // //In case of error, showing a message box to the user // X.MessageBox.ButtonText.Ok = Resources.Common.Ok; // X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorDeletingRecord).Show(); // } //} /// <summary> /// Deleting all selected record /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <summary> /// Direct method for removing multiple records /// </summary> /// <summary> /// Adding new record /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void ADDNewCO(object sender, DirectEventArgs e) { //Reset all values of the relative object ContactsForm.Reset(); this.EditContactWindow.Title = Resources.Common.AddNewRecord; FillCONationality(); FillCOState(); this.EditContactWindow.Show(); }
private void GenSubFormAndShow() { selfInfoForm = new SelfInfoForm(); selfInfoForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; selfInfoForm.TopLevel = false; contactsForm = new ContactsForm(); contactsForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; contactsForm.TopLevel = false; selfCheckForm = new SelfCheckForm(); selfCheckForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; selfCheckForm.TopLevel = false; contactsForm.Show(); selfInfoForm.Show(); selfCheckForm.Show(); }
public async Task <bool> PostContactAsync(ContactsForm contact) { try { // add a new contact _context.Contacts.Add(new Contact() { ContactName = contact.ContactName, BirthDate = Convert.ToDateTime(contact.BirthDate), ContactTypeId = Convert.ToInt32(contact.ContactTypeId), PhoneNumber = contact.PhoneNumber }); await _context.SaveChangesAsync(); return(true); } catch (Exception) { return(false); } }
public async Task <bool> PutContactAsync(ContactsForm contact) { if (ContactExists(Convert.ToInt32(contact.id))) { // set the values from the from _context.Entry(new Contact() { Id = Convert.ToInt32(contact.id), ContactName = contact.ContactName, PhoneNumber = contact.PhoneNumber, BirthDate = Convert.ToDateTime(contact.BirthDate), ContactTypeId = Convert.ToInt32(contact.ContactTypeId) }).State = EntityState.Modified; await _context.SaveChangesAsync(); return(true); } else { return(false); } }
private void OpenFormContact(object arg) { var contact = new ContactsForm(); contact.Show(); }
public ContactsFormPresenter(ContactsForm form) { view = form; data = new ContactsDataFile(); }