public Order(int orderID, string CustomerID, int EmployeeID) { this.orderID = orderID; this.CustomerID = CustomerID; this.EmployeeID = EmployeeID; Status = WorkEnum.New; }
public Order(int orderID, string CustomerID, int EmployeeID, DateTime OrderDate, DateTime RequiredDate, DateTime ShippedDate, int ShipVia, decimal Freight, string ShipName, string ShipAddress, string ShipCity, string ShipRegion, string ShipPostalCode, string ShipCounty) { this.orderID = orderID; this.CustomerID = CustomerID; this.EmployeeID = EmployeeID; this.OrderDate = OrderDate; this.RequiredDate = RequiredDate; this.ShippedDate = ShippedDate; this.ShipVia = ShipVia; this.Freight = Freight; this.ShipName = ShipName; this.ShipAddress = ShipAddress; this.ShipCity = ShipCity; this.ShipRegion = ShipRegion; this.ShipPostalCode = ShipPostalCode; this.ShipCounty = ShipCounty; if (ShippedDate == DateTime.MinValue) { if (OrderDate == DateTime.MinValue) { Status = WorkEnum.New; } else { Status = WorkEnum.InTheWork; } } else { Status = WorkEnum.Made; } }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] WorkEnum workEnum) { if (id != workEnum.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(workEnum); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorkEnumExists(workEnum.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(workEnum)); }
public void CanChangeWorkEnumName() { var u = new WorkEnum { Id = 3, Name = "name" }; u.Name = "Text"; Assert.Equal("Text", u.Name); }
public void CanChangeWorkEnumId() { var u = new WorkEnum { Id = 3, Name = "name" }; u.Id = 4; Assert.Equal(4, u.Id); }
public async Task <IActionResult> Create([Bind("Id,Name")] WorkEnum workEnum) { if (ModelState.IsValid) { _context.Add(workEnum); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(workEnum)); }
public Order() { Status = WorkEnum.New; }