コード例 #1
0
        public static ProductPosition GenerateRandomProductPosition(Product prod, Center cent)
        {
            Random rand = new Random();

            return(new ProductPosition(prod, cent, rand.Next(46)));
        }
コード例 #2
0
 public ObservableCollection <Truck> GetTrucks(Center center)
 {
     return(repository.GetTrucks(center));
 }
コード例 #3
0
 public ProductPosition(Product prod, Center cent, int num)
 {
     product         = prod;
     productCenter   = cent;
     NumberOfProduct = num;
 }
コード例 #4
0
 public ObservableCollection <Require> GetDBRequiersTo(Center center)
 {
     return(repository.GetDBRequiersTo(center));
 }
コード例 #5
0
 public ObservableCollection <ProductPosition> GetDBCenterProductsPosition(Center center)
 {
     return(repository.GetDBCenterProductsPosition(center));
 }
コード例 #6
0
 public Trip GetTripForSlots(Center center)
 {
     return(repository.GetTripForSlots(center));
 }
コード例 #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;
        }
コード例 #8
0
 public void closeTrip(Center center)
 {
     CurrentCenter = center;
     if_busy       = false;
     controller.UpdateTruck(this);
 }
コード例 #9
0
 public void SendInTrip()
 {
     CurrentCenter = controller.GetDBCenters().Where(c => c.Id == 17).FirstOrDefault();
     SetBusy();
     controller.UpdateTruck(this);
 }
コード例 #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;
 }