Beispiel #1
0
        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));
        }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        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 { });
        }
Beispiel #5
0
 public int Complete()
 {
     return(_context.SaveChanges());
 }