public ActionResult Contact(string id) { ContactRecord model = new ContactRecord(); model.Message = "Vin #: " + id; return(View(model)); }
//[HttpGet] //public Array GetTodaysCallBack() //{ // DateTime today = DateTime.Today; // DateTime tomorrow = DateTime.Today.AddDays(1); // var callBackDates = db.ContactRecords // .Where(x => x.CallbackDatetime >= today) // .Where(x => x.CallbackDatetime < tomorrow) // .Select(p => new { p.LeadRecordID, p.CallbackDatetime }).ToList(); // return callBackDates.ToArray(); //} //[ResponseType(typeof(Array))] //[HttpGet] //public IHttpActionResult GetRangeCallBack(string startdate, string enddate) //{ // try // { // DateTime tempdate; // DateTime tempdate2; // if (startdate.Length == 10) // { // tempdate = DateTime.ParseExact(startdate, "yyyy-MM-dd", CultureInfo.InvariantCulture); // } // else if (startdate.Length == 16) // { // tempdate = DateTime.ParseExact(startdate, "yyyy-MM-dd-HH-mm", CultureInfo.InvariantCulture); // } // else // { return BadRequest(); } // if (enddate.Length == 10) // { // tempdate2 = DateTime.ParseExact(enddate, "yyyy-MM-dd", CultureInfo.InvariantCulture); // } // else if (enddate.Length == 16) // { // tempdate2 = DateTime.ParseExact(enddate, "yyyy-MM-dd-HH-mm", CultureInfo.InvariantCulture); // } // else // { return BadRequest(); } // DateTime sdate; // DateTime edate; // if (tempdate < tempdate2) // { // sdate = tempdate; // edate = tempdate2; // } // else // { // sdate = tempdate2; // edate = tempdate; // } // var callBackDates = db.ContactRecords // .Where(x => x.CallbackDatetime >= sdate) // .Where(x => x.CallbackDatetime < edate) // .Select(p => new { p.LeadRecordID, p.CallbackDatetime }).ToList(); // return Ok(callBackDates); // } // catch // { // return BadRequest(); // } //} // PUT api/Contact/5 public IHttpActionResult PutContactRecord(int id, ContactRecord contactrecord) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != contactrecord.ContactId) { return(BadRequest()); } db.Entry(contactrecord).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ContactRecordExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void SendPassAlongContact(ContactRecord record, UnitOfWork db) { // Get users in pastor or leadership role. var users = db.AppUserRepository .FindUsers(u => db.AppUserRepository.IsInRole(u.Email, AppUserRole.Pastor) || db.AppUserRepository.IsInRole(u.Email, AppUserRole.DeaconLeadership)); // Get user who is sending the email var appUser = db.AppUserRepository.FindUserById(record.AppUserId); var sb = new StringBuilder(); foreach (var user in users) { var email = GetPassAlongEmail(record, user, db, sb); try { // TODO: do something with response // We could give the deacon confirmation email sent var response = Send(email); // Update 'pass along' record var passAlongContact = db.PassAlongContactRepository.FindById(record.Id); passAlongContact.PassAlongEmailSent = true; //db.PassAlongContactRepository.Update(passAlongContact); //db.Commit(); } catch (Exception ex) { throw new Exception("Pass along email not sent."); } } }
public IHttpActionResult PutContactRecord(ContactRecord contactRecord) { string validationErrors = ""; if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var currentContactRecord = db.ContactRecords.Find(contactRecord.ContactId); db.Entry(currentContactRecord).CurrentValues.SetValues(contactRecord); db.Entry(currentContactRecord).State = EntityState.Modified; db.SaveChanges(); } catch (DbEntityValidationException e) { foreach (DbEntityValidationResult eve in e.EntityValidationErrors) { foreach (DbValidationError ve in eve.ValidationErrors) { string error = ve.PropertyName + " - " + ve.ErrorMessage; validationErrors += System.Environment.NewLine + error; } } string x = validationErrors; } return(StatusCode(HttpStatusCode.NoContent)); }
protected override void ApplySnapshot(Frame snapframe, Frame targframe, bool snapIsValid, bool targIsValid) { base.ApplySnapshot(snapframe, targframe, snapIsValid, targIsValid); if (snapframe.content == FrameContents.Complete) { List <ContactRecord> contacts = snapframe.contactRecords; for (int i = 0, cnt = contacts.Count; i < cnt; ++i) { ContactRecord contact = contacts[i]; var pv = PhotonNetwork.GetPhotonView(contact.contactSystemViewID); if (pv && pv.IsMine) { var cm = pv.GetComponent <ContactManager>(); if (cm) { var currentAttachedICS = cm.GetContacting(contact.contactSystemIndex); // Retry the trigger and see if this will consume it, if so run pickup to apply it. var contactevent = new ContactEvent(currentAttachedICS, contactTrigger, contact.contactType); var consumed = Contact(contactevent); if (consumed != Consumption.None) { Consume(snapframe, contactevent, consumed); } } } } } }
// GET: ContactRecords/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ContactRecord contactRecord = unitOfWork.ContactRecordRepository.FindById(id); if (contactRecord == null) { return(HttpNotFound()); } var contactRecordVM = Mapper.Map <DetailsContactRecordViewModel>(contactRecord); if (contactRecordVM.Private) { // Get user object var user = unitOfWork.AppUserRepository.FindUserByEmail(User.Identity.Name); _service.KeepCommentsPrivate(contactRecordVM, user.Id); } return(View(contactRecordVM)); }
/// <summary> /// Utility functions to build the Json format for records and reports. /// </summary> private StringContent BuildJsonRecord(ContactRecord record) { var json = JsonConvert.SerializeObject(record); var data = new StringContent(json, Encoding.UTF8, "application/json"); return(data); }
private void LogTheAction(eNums.eReadUpdateCreateDelete actionType) { //START LOGGING ================================================================================================================<<< string sX = ContactRecord.GetStringWith_RecordProperties(); contactDBContext dcLog = new contactDBContext(); T000MvcLogging logRecord = new T000MvcLogging(); logRecord.ApplicationAssemblyName = General_Application_Extensions.fn_ReturnApplicationName(); logRecord.Browser = Browser; logRecord.CreateUpdateDeleteRead = actionType.ToString(); if (actionType != eNums.eReadUpdateCreateDelete.Read) { logRecord.Note = sX; //need to add serialized values } else { actionType.ToString(); } logRecord.UserLogIn = General_ActiveDirectory_Extensions.fn_sUser(); string localIP = ""; localIP = IP; logRecord.ComputerName = General_String_Extensions.General_functions.fn_ComputerName(localIP); dcLog.T000MvcLogging.Add(logRecord); dcLog.SaveChanges(); //END LOGGING ================================================================================================================<<< }
public SerializationFlags OnNetDeserialize(int originFrameId, byte[] buffer, ref int bitposition, FrameArrival arrival) { Frame frame = frames[originFrameId]; // Get first content bool to see if we have any contacts at all. bool hasContent = buffer.ReadBool(ref bitposition); if (hasContent) { /// if pickup event bool do { var tes = frame.contactRecords; var te = new ContactRecord( (int)buffer.ReadPackedBytes(ref bitposition, 32), (byte)buffer.ReadPackedBits(ref bitposition, 8), (ContactType)(1 << (int)buffer.Read(ref bitposition, 2)) ); //Debug.LogError(name + " DES: " + te); tes.Add(te); } // Loop for all contact records. while (buffer.ReadBool(ref bitposition)); frame.content = FrameContents.Complete; return(SerializationFlags.HasContent /*| SerializationFlags.ForceReliable*/); } // No contact records frame.content = FrameContents.Empty; return(SerializationFlags.None); }
public async Task <ActionResult <ContactRecord> > Record(ContactRecord contactRecord) { var contactService = new ContactService(_context, _config); await contactService.Save(contactRecord); return(CreatedAtAction("Record", new { id = contactRecord.Id }, contactRecord)); }
// GET: House/Delete/5 public ActionResult Delete(ContactRecord QueryID) { var d = rentalHouseEntities.ContactRecords.Where(x => x.id == QueryID.id).FirstOrDefault(); rentalHouseEntities.ContactRecords.Remove(d); rentalHouseEntities.SaveChanges(); return(RedirectToAction("ContactRecord")); }
public ActionResult DeleteConfirmed(int id, DeleteContactRecordViewModel viewModel) { ContactRecord contactRecord = unitOfWork.ContactRecordRepository.FindById(id); unitOfWork.ContactRecordRepository.Delete(contactRecord); return(Redirect(viewModel.ReturnUrl)); }
public ActionResult DeleteConfirmed(int id) { ContactRecord contactRecord = db.Contacts.Find(id); db.Contacts.Remove(contactRecord); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Purchase/Delete/5 public ActionResult Delete(ContactRecord IdtoDel) { var d = carData.ContactRecords.Where(x => x.ID == IdtoDel.ID).FirstOrDefault(); carData.ContactRecords.Remove(d); carData.SaveChanges(); return(RedirectToAction("QueryList")); }
public static void UpdateByViewModel(ContactRecord record, ContactVm contactVm) { record.Type = (byte)contactVm.Type; record.Title = contactVm.Title.TrimIt().StripTags(); record.Contact = contactVm.Contact.TrimIt().StripTags(); record.IsDeleted = contactVm.Destroy; }
public IHttpActionResult PostContactRecord(ContactRecord contactRecord) { //LeadRecord leadRecord = db.LeadRecords.Find(contactRecord.LeadRecordID); db.ContactRecords.Add(contactRecord); db.SaveChanges(); return(Ok(contactRecord)); }
public ActionResult Edit([Bind(Include = "ID,FirstName,LastName,Patronymic,BirthDate,Company,ContactInformation")] ContactRecord contactRecord) { if (ModelState.IsValid) { db.Entry(contactRecord).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contactRecord)); }
public async Task AddUpdateContactRecord(ContactRecord contactRecord) { _context.Entry(contactRecord).State = contactRecord.Id == 0 ? EntityState.Added : EntityState.Modified; if (_context.ChangeTracker.HasChanges()) { await _context.SaveChangesAsync(); } }
private static Contact CreateDataContract(ContactRecord record) { var result = new Contact { Type = (ContactType)record.Type, Title = record.Title, ContactText = record.Contact }; return(result); }
public IHttpActionResult GetContactRecordByLeadId(string leadId) { ContactRecord contactRecord = db.ContactRecords.Where(x => x.LeadRecordId == leadId).OrderByDescending(y => y.ContactId).LastOrDefault(); // Remove condition && x.DispositionCode != null if (contactRecord == null) { return(NotFound()); } return(Ok(contactRecord)); }
public static int AddContactRecord(ContactRecord cr) { string sql = "insert into ContactRecord (UserID,ProjectID,Content,RecordDate) values (@UserID,@ProjectID,@Content,@RecordDate)"; OleDbParameter[] param = { new OleDbParameter("@UserID",OleDbType.Integer){Value=cr.UserID}, new OleDbParameter("@ProjectID",OleDbType.Integer){Value=cr.ProjectID}, new OleDbParameter("@Content",OleDbType.VarChar){Value=cr.Content}, new OleDbParameter("@RecordDate",OleDbType.DBDate){Value=cr.RecordDate} }; return AccSqlHelper.ExecuteNonQuery(sql, param); }
public IHttpActionResult GetContactRecordByContactId(int contactId) { ContactRecord contactRecord = db.ContactRecords.Find(contactId); if (contactRecord == null) { return(NotFound()); } return(Ok(contactRecord)); }
public ActionResult Create([Bind(Include = "FirstName,LastName,Patronymic,BirthDate,Company")] ContactRecord contactRecord) { if (ModelState.IsValid) { db.Contacts.Add(contactRecord); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contactRecord)); }
public IHttpActionResult GetFirstContact(string id, string clientId) { ContactRecord contactrecord = db.ContactRecords.Where(b => b.ClientCallId.Equals(id) && b.ClientId.Equals(clientId)).FirstOrDefault(); if (contactrecord == null) { return(NotFound()); } return(Ok(contactrecord)); }
public IHttpActionResult GetSPContact(int id) { ContactRecord contactrecord = db.ContactRecords.Find(id); if (contactrecord == null) { return(NotFound()); } return(Ok(contactrecord)); }
public void LoadContactRecord() { if (ContactRecord.Displayed) { ContactRecord.Click(); driver.FindElement(By.CssSelector("#efpViews_0037E00000Sk04D_option1 > span.optionLabel")).Click(); } else { throw new Exception("Record is not found or not clickable"); } }
public async Task <IActionResult> SaveNewRecord(ContactRecord record) { var result = await _reportProcessor.SaveRecord(record); var x = _accessor.HttpContext.Session.GetString("token"); if (!String.IsNullOrEmpty(result)) { return(RedirectToAction("Success", "Home")); } return(RedirectToAction("NewRecord")); }
public IHttpActionResult PostContactRecord(ContactRecord contactrecord) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ContactRecords.Add(contactrecord); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = contactrecord.ContactId }, contactrecord)); }
public async Task <string> EditRecord(ContactRecord record) { string url = $"https://{apiUrl}/api/Report/{record.Id}"; var apiHelper = new ApiHelper(_accessor).InitializeClient(); var data = BuildJsonRecord(record); var response = await apiHelper.PutAsync(url, data); if (!response.IsSuccessStatusCode) { return(null); } return(response.Content.ReadAsStringAsync().Result); }
public IHttpActionResult GetContactRecordByLeadClient(string leadId, string clientCallId) { var today = System.DateTime.Now.AddMinutes(-5); //ContactRecord contactRecord = db.ContactRecords.Where(x=> x.LeadRecordId == leadId && x.ClientCallId == clientCallId && x.DispositionCode == null && x.CallStartDateTime.Value > today).FirstOrDefault(); ContactRecord contactRecord = db.ContactRecords.Where(x => x.LeadRecordId == leadId && x.ClientCallId == clientCallId && x.CallStartDateTime.Value > today).FirstOrDefault(); if (contactRecord == null) { return(NotFound()); } return(Ok(contactRecord)); }
public IHttpActionResult DeleteContactRecord(int id) { ContactRecord contactrecord = db.ContactRecords.Find(id); if (contactrecord == null) { return(NotFound()); } db.ContactRecords.Remove(contactrecord); db.SaveChanges(); return(Ok(contactrecord)); }
private void btnSureAdd_Click(object sender, EventArgs e) { ContactRecord cr = new ContactRecord(); if (proID == 0) { Common.MessageBoxShow("不好意思出错了"); } cr.ProjectID = proID; cr.UserID = Convert.ToInt32(cmbUser.SelectedValue); cr.Content = txtContactRecord.Text; cr.RecordDate = dtRecord.Value; if (ContactRecordBLL.AddContactRecord(cr)) { Common.MessageBoxShow("添加成功",false); this.Close(); } else { Common.MessageBoxShow("不好意思出错了"); } }
private static List< ContactRecord> DTToObj(DataTable dt) { if (dt==null) { return null; } List<ContactRecord> list = new List<ContactRecord>(); for (int i = 0; i < dt.Rows.Count; i++) { ContactRecord cr = new ContactRecord(); if (dt.Rows[i]["Content"] == null || dt.Rows[i]["Content"].ToString().Equals("")) { cr.Content = ""; } else { cr.Content = dt.Rows[i]["Content"].ToString(); } if (dt.Rows[i]["RecordDate"] == null || dt.Rows[i]["RecordDate"].ToString().Equals("")) { cr.RecordDate = null; } else { cr.RecordDate = Convert.ToDateTime(dt.Rows[i]["RecordDate"]); } cr.ProjectID = Convert.ToInt32(dt.Rows[i]["ProjectID"]); cr.Project = ProjectDAL.GetProjectByProID(cr.ProjectID); cr.RecordID = Convert.ToInt32(dt.Rows[i]["RecordID"]); cr.UserID = Convert.ToInt32(dt.Rows[i]["UserID"]); cr.UserInfo = UserInfoDAL.GetUserByUserID(cr.UserID); cr.salesmanName = cr.UserInfo.UserName; list.Add(cr); } return list; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ContactRecord obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }
public static bool AddContactRecord(ContactRecord cr) { return ContactRecordDAL.AddContactRecord(cr) > 0; }