public static ProductPosition GenerateRandomProductPosition(Product prod, Center cent)
        {
            Random rand = new Random();

            return(new ProductPosition(prod, cent, rand.Next(46)));
        }
Exemple #2
0
 public ObservableCollection <Truck> GetTrucks(Center center)
 {
     return(repository.GetTrucks(center));
 }
 public ProductPosition(Product prod, Center cent, int num)
 {
     product         = prod;
     productCenter   = cent;
     NumberOfProduct = num;
 }
Exemple #4
0
 public ObservableCollection <Require> GetDBRequiersTo(Center center)
 {
     return(repository.GetDBRequiersTo(center));
 }
Exemple #5
0
 public ObservableCollection <ProductPosition> GetDBCenterProductsPosition(Center center)
 {
     return(repository.GetDBCenterProductsPosition(center));
 }
Exemple #6
0
 public Trip GetTripForSlots(Center center)
 {
     return(repository.GetTripForSlots(center));
 }
Exemple #7
0
        public Employee(string sorname, string name, string second_name, string role, string password, string phone, Center center)
        {
            Sorname    = sorname;
            Name       = name;
            SecondName = second_name;

            if (role.Equals("Admin") || role.Equals("Employee") || role.Equals("Администратор") || role.Equals("Сотрудник"))
            {
                this.role = role;
            }
            else
            {
                throw new Exception("Неверно указан статус. Допустимые значение: Admin/Employee/Администратор/Сотрудник");
            }
            //Шифрование
            var md5 = MD5.Create();

            byte[] hash   = md5.ComputeHash(Encoding.UTF8.GetBytes(password));
            string result = "";

            foreach (byte bit in hash)
            {
                result += bit;
            }
            this.password = result;
            //
            this.center = center;
            phoneNumber = phone;
        }
Exemple #8
0
 public void closeTrip(Center center)
 {
     CurrentCenter = center;
     if_busy       = false;
     controller.UpdateTruck(this);
 }
Exemple #9
0
 public void SendInTrip()
 {
     CurrentCenter = controller.GetDBCenters().Where(c => c.Id == 17).FirstOrDefault();
     SetBusy();
     controller.UpdateTruck(this);
 }
Exemple #10
0
 public Truck(string reg, float cnsmpshn, int slots, int load_cap, int volume_cap, bool busy, Center center)
 {
     Id = reg;
     fuel_consumption = cnsmpshn;
     this.slots       = slots;
     load_capacity    = load_cap;
     volume_capcity   = volume_cap;
     if_busy          = busy;
     CurrentCenter    = center;
 }