// PUT api/LeadRecord/5 public IHttpActionResult PutLeadRecord(string id, LeadRecord leadrecord) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != leadrecord.LeadRecordId) { return(BadRequest()); } db.Entry(leadrecord).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!LeadRecordExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
// PUT api/OrderDetail/5 public IHttpActionResult PutOrderDetail(decimal id, OrderDetail orderdetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != orderdetail.OrderId) { return(BadRequest()); } db.Entry(orderdetail).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!OrderDetailExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostContactRecord(ContactRecord contactRecord) { //LeadRecord leadRecord = db.LeadRecords.Find(contactRecord.LeadRecordID); db.ContactRecords.Add(contactRecord); db.SaveChanges(); return(Ok(contactRecord)); }
public IHttpActionResult PostIDRServiceQueue(IDRServiceQueue queue) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.IDRServiceQueues.Add(queue); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = queue.IDRServiceQueueId }, queue)); }
public virtual void UpdateLead(LeadRecord leadRecord) { try { db.Entry(leadRecord).State = EntityState.Modified; db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public ActionResult Create([Bind(Include = "IDRServiceQueueId,ContactId,ClientCallId,ServiceQueue,Status,CreatedDate,ModifiedDate,ClientId")] IDRServiceQueue iDRServiceQueue) { if (ModelState.IsValid) { db.IDRServiceQueues.Add(iDRServiceQueue); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ContactId = new SelectList(db.ContactRecords, "ContactId", "ClientCallId", iDRServiceQueue.ContactId); return(View(iDRServiceQueue)); }
public ActionResult Create([Bind(Include = "ContactRecordDetailId,ContactId,QuestionId,QuestionText,QuestionResponseText,QuestionResponseValue,QuestionKeys")] ContactRecordDetail contactRecordDetail) { if (ModelState.IsValid) { db.ContactRecordDetails.Add(contactRecordDetail); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ContactId = new SelectList(db.ContactRecords, "ContactId", "ClientCallId", contactRecordDetail.ContactId); return(View(contactRecordDetail)); }
public IHttpActionResult PostErrorLog(Data.Log log) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Logs.Add(log); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = log.LogId }, log)); } catch (Exception ex) { return(StatusCode(HttpStatusCode.InternalServerError)); } }
public static Data.Log Save(this Exception ex, HttpSessionStateBase Session, string callDetail, ImpactLevel impactLevel, string errorDescription) { using (var db = new ScreenPlayCRMEntities()) { Data.Log log = new Data.Log(); log.ContactId = SessionControl.SessionManager.GetContactId(Session); log.ClientId = SessionControl.SessionManager.GetClientId(Session); log.UserId = SessionControl.SessionManager.GetUserId(Session); log.CallDetail = callDetail; log.ErrorDate = DateTime.Now; log.LastModified = DateTime.Now; if (errorDescription != null && errorDescription != "") { log.ErrorShortDescription = errorDescription; } log.ExceptionType = ex.GetType().FullName; var stackTrace = new StackTrace(ex, true); var allFrames = stackTrace.GetFrames().ToList(); foreach (var frame in allFrames) { log.FileName = frame.GetFileName(); log.LineNumber = frame.GetFileLineNumber(); var method = frame.GetMethod(); log.MethodName = method.Name; log.ClassName = frame.GetMethod().DeclaringType.ToString(); } log.ImpactLevel = impactLevel.ToString(); try { log.ApplicationName = Assembly.GetCallingAssembly().GetName().Name; } catch { log.ApplicationName = ""; } log.ErrorMessage = ex.Message; log.StackTrace = ex.StackTrace; if (ex.InnerException != null) { log.InnerException = ex.InnerException.ToString(); log.InnerExceptionMessage = ex.InnerException.Message; } log.IpAddress = ""; try { db.Logs.Add(log); db.SaveChanges(); } catch (Exception eex) { } return(log); } }