Exemple #1
0
        public ActionResult CreateOperation(Models.Operations.OperationInsert model)
        {
            Models.DB.Operation dbOperation = new Models.DB.Operation();
            Int32 operationId;

            dbOperation.OperationNumber = model.OperationNumber;
            dbOperation.SequenceNumber  = model.SequenceNumber;
            dbOperation.OperationStart  = model.Start;
            dbOperation.OperationEnd    = model.End;
            dbOperation.Title           = model.Title;
            dbOperation.Notes           = model.Notes;
            dbOperation.Created         = DateTime.UtcNow;

            try
            {
                _context.Operation.Add(dbOperation);
                _context.SaveChanges();
                operationId = dbOperation.OperationId;
            }
            catch (Exception exc)
            {
                throw exc;
            }

            return(RedirectToAction("Edit", new { id = operationId }));
        }
Exemple #2
0
        public ActionResult CreateOperation()
        {
            Models.Operations.OperationInsert model = new Models.Operations.OperationInsert();
            model.Start = DateTime.Now;
            model.End   = DateTime.Now;

            return(View(model));
        }