Пример #1
0
        public static void Add(EditableOrder order)
        {
            int id = GetAllRecords().Max(o => o.OrderID);

            order.OrderID = id + 1;
            GetAllRecords().Insert(0, order);
        }
 public static void ComplexUpdate(List <EditableOrder> record)
 {
     foreach (var temp in record)
     {
         EditableOrder result = GetComplexRecords().Where(o => o.OrderID == temp.OrderID).FirstOrDefault();
         if (result != null)
         {
             result.OrderID             = temp.OrderID;
             result.OrderDate           = temp.OrderDate;
             result.CustomerID          = temp.CustomerID;
             result.EmployeeID          = temp.EmployeeID;
             result.Freight             = temp.Freight;
             result.ShipAddress         = temp.ShipAddress;
             result.ShipCity            = temp.ShipCity;
             result.ShipName            = temp.ShipName;
             result.ShipPostalCode      = temp.ShipPostalCode;
             result.ShipRegion          = temp.ShipRegion;
             result.ShipCountry         = temp.ShipCountry;
             result.Verified            = temp.Verified;
             result.Employee.Address    = temp.Employee.Address;
             result.Employee.FirstName  = temp.Employee.FirstName;
             result.Employee.LastName   = temp.Employee.LastName;
             result.Employee.EmployeeID = temp.Employee.EmployeeID;
         }
     }
 }
Пример #3
0
 public static void Delete(List <EditableOrder> order)
 {
     foreach (var temp in order)
     {
         EditableOrder result = GetAllRecords().Where(o => o.OrderID == temp.OrderID).FirstOrDefault();
         GetAllRecords().Remove(result);
     }
 }
 public static void ComplexDelete(List <EditableOrder> record)
 {
     foreach (var temp in record)
     {
         EditableOrder result = GetComplexRecords().Where(o => o.OrderID == temp.OrderID).FirstOrDefault();
         GetComplexRecords().Remove(result);
     }
 }
Пример #5
0
        public static void Update(EditableOrder order)
        {
            EditableOrder result = GetAllRecords().Where(o => o.OrderID == order.OrderID).FirstOrDefault();

            if (result != null)
            {
                result.OrderID        = order.OrderID;
                result.OrderDate      = order.OrderDate;
                result.CustomerID     = order.CustomerID;
                result.EmployeeID     = order.EmployeeID;
                result.Freight        = order.Freight;
                result.ShipAddress    = order.ShipAddress;
                result.ShipCity       = order.ShipCity;
                result.ShipName       = order.ShipName;
                result.ShipPostalCode = order.ShipPostalCode;
                result.ShipRegion     = order.ShipRegion;
                result.ShipCountry    = order.ShipCountry;
                result.Verified       = order.Verified;
            }
        }
        public static void ComplexUpdate(EditableOrder record)
        {
            EditableOrder result = GetComplexRecords().Where(o => o.OrderID == record.OrderID).FirstOrDefault();

            if (result != null)
            {
                result.OrderID             = record.OrderID;
                result.OrderDate           = record.OrderDate;
                result.CustomerID          = record.CustomerID;
                result.EmployeeID          = record.EmployeeID;
                result.Freight             = record.Freight;
                result.ShipAddress         = record.ShipAddress;
                result.ShipCity            = record.ShipCity;
                result.ShipName            = record.ShipName;
                result.ShipPostalCode      = record.ShipPostalCode;
                result.ShipRegion          = record.ShipRegion;
                result.ShipCountry         = record.ShipCountry;
                result.Verified            = record.Verified;
                result.Employee.Address    = record.Employee.Address;
                result.Employee.FirstName  = record.Employee.FirstName;
                result.Employee.LastName   = record.Employee.LastName;
                result.Employee.EmployeeID = record.Employee.EmployeeID;
            }
        }
Пример #7
0
        public static void Delete(int OrderID)
        {
            EditableOrder result = GetAllRecords().Where(o => o.OrderID == OrderID).FirstOrDefault();

            GetAllRecords().Remove(result);
        }
 public static void Add(EditableOrder order)
 {
     GetAllRecords().Insert(0, order);
 }
 public static void ComplexAdd(EditableOrder record)
 {
     GetComplexRecords().Insert(0, record);
 }