public JsonResult Send(string name, string mobile, string address, string email, string content) { var feedback = new Feedback(); feedback.Name = name; feedback.Email = email; feedback.CreatedDate = DateTime.Now; feedback.Phone = mobile; feedback.Content = content; feedback.Address = address; var id = new ContactD().InsertFeedBack(feedback); if (id > 0) { return(Json(new { status = true })); //send mail } else { return(Json(new { status = false })); } }
private List<ContactD> GetCheckedContactList() { List<ContactD> listCheckedContact = new List<ContactD>(); /*int count = listview_contacts.Items.Count; for (int i = 0; i < count; i++) { Object item = listview_contacts.Items[i]; if (item is ListViewContactItem) { if (((ListViewContactItem)item).IsCheck) { int idx = ((ListViewContactItem)item).Index; listCheckedContact.Add(listContact[idx]); } } }*/ if(listview_contacts != null) { //List<object> list_obj = listview_contacts.SelectedItems.ToList(); foreach (ContactView obj in listCheckedContactIds) { ContactD c = new ContactD { Id = obj.Id, Name = obj.Name, FirstName = obj.FirstName, LastName = obj.LastName, MiddleName = obj.MiddleName, Emails = new List<Email> { new Email { Value = obj.EmailAddress }}, Faxes = new List<Fax> { new Fax {Value = obj.Fax } } }; listCheckedContact.Add(c); } } return listCheckedContact; }
// GET: Contact public ActionResult Index() { var model = new ContactD().GetActiveContact(); return(View(model)); }
//private void cb_export_SelectionChanged(object sender, SelectionChangedEventArgs e) //{ // try // { // var exportName = ((ComboBoxItem)e.AddedItems[0]).Content; // var list = GetCheckedContactList(); // switch (exportName.ToString()) // { // case "To CSV": // ImportExport.Instance().ExportToCSV(list); // break; // case "To Vcard": // ImportExport.Instance().ExportToVCFPrinterMode(list); // break; // default: // break; // } // cb_export.SelectedItem = null; // } // catch (Exception ex) // { // System.Diagnostics.Debug.WriteLine(ex.Message); // cb_export.SelectedItem = null; // } //} private List<ContactD> GetCheckedContactList() { List<ContactD> listCheckedContact = new List<ContactD>(); if (listview_contacts != null) { //List<object> list_obj = listview_contacts.SelectedItems.ToList(); List<object> list_obj = listview_contacts.Items.Where(l => ((ContactView)l).IsChecked == true).ToList(); foreach (ContactView obj in list_obj) { ContactD c = new ContactD { Id = obj.Id, Name = obj.Name, FirstName = obj.FirstName, LastName = obj.LastName, MiddleName = obj.MiddleName, Emails = new List<Email> { new Email { Value = obj.EmailAddress } }, Faxes = new List<Fax> { new Fax { Value = obj.Fax } } }; listCheckedContact.Add(c); } } return listCheckedContact; }