public ActionResult Create([Bind(Include = "ReportTitle,Date,Reporter,ID,Details")] Report report) { if (ModelState.IsValid) { db.Reports.Add(report); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(report)); }
public ActionResult Create([Bind(Include = "Id,Name,DonationType,Village,City,State,Pincode,MobileNo,AMount")] ReceiptData invoiceData) { if (ModelState.IsValid) { db.ReceiptData.Add(invoiceData); db.SaveChanges(); return(RedirectToAction("Index")); } //else //{ // invoiceData.DonationType = db.DonationTypes.ToList(); //} return(View(invoiceData)); }
public async Task <bool> AddReport(DataModel.Report report) { try { report.InputUnitOfMeasure = report.ExamQuestion.InputUnitOfMeasure; report.InputValue = report.ExamQuestion.InputValue; report.IsCorrect = report.ExamQuestion.IsCorrect; report.StudentID = report.ExamQuestion.StudentID; report.OutPutUnitOfMeasure = report.ExamQuestion.OutPutUnitOfMeasure; report.StudentName = report.ExamQuestion.StudentName; report.TeacherName = report.ExamQuestion.TeacherName; report.StudentResponse = report.ExamQuestion.StudentResponse; await _reportDBContext.Report.AddAsync(report); _reportDBContext.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public void MyEventBut_EsiEventReceived(object sender, BasicDeliverEventArgs e) { // throw new NotImplementedException(object sender, BasicDeliverEventArgs e); // var obj = new ReportModels(); var messagein = Encoding.UTF8.GetString(e.Body); _reportDBContext.ReportHello.Add(new ReportModels() { message = messagein }); _reportDBContext.SaveChanges(); // IServiceProvider. // var dbc = new ReportDBContext(); //_reportDBContext.ReportHello.Add(new _reportDBContext.ReportHello { }); }
public int Complete() { return(_context.SaveChanges()); }