Beispiel #1
0
 public Movie(string title, ProductionYear productionYear)
 {
     ActorIds       = new HashSet <Guid>();
     DirectorIds    = new HashSet <Guid>();
     Id             = Guid.NewGuid();
     ProductionYear = productionYear;
     Title          = title;
 }
        public void GenerateNewSerialNumber()
        {
            try
            {
                SerialNumber1 = Project.Substring(2, 3) + ProductionPlace + ProductionLine + MoldNumber + CavityNumber;
                SerialNumber2 = ProductionYear.Substring(2, 2) + ProductionWeek + SerialNumber;
            }

            catch (ArgumentOutOfRangeException)
            { MessageBox.Show("Invalid value!! \r\nPlease check the value!"); }

            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #3
0
        public int CompareTo(Car other)
        {
            // If other is not a valid object reference, this instance is greater.
            if (other is null)
            {
                return(1);
            }

            //If the ProductionYear is the same
            if (ProductionYear == other.ProductionYear)
            {
                return(Model.CompareTo(other.Model));
            }

            // The car comparison depends on the comparison of
            // the underlying int values for production year.
            return(ProductionYear.CompareTo(other.ProductionYear));
        }
Beispiel #4
0
        public bool CheckCredentials()
        {
            if (string.IsNullOrEmpty(Manufacturer) || string.IsNullOrWhiteSpace(Manufacturer) || string.IsNullOrEmpty(Model) || string.IsNullOrWhiteSpace(Model) || string.IsNullOrEmpty(Review) || string.IsNullOrWhiteSpace(Review) ||
                string.IsNullOrEmpty(Color) || string.IsNullOrWhiteSpace(Color) ||
                string.IsNullOrEmpty(Image) || string.IsNullOrWhiteSpace(Image) || !Image.StartsWith("http") ||
                string.IsNullOrEmpty(ProductionYear.ToString()) || string.IsNullOrWhiteSpace(ProductionYear.ToString()))
            {
                HasErrors = true;
            }
            else
            {
                HasErrors = false;
            }

            if (!HasErrors)
            {
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder($"{{ ItemId = {ItemID}");

            sb.Append($", InventoryNumber = {InventoryNumber}");
            sb.Append($", OldInventoryNumber = {OldInventoryNumber}");
            sb.Append($", SerialNumber = {SerialNumber}");
            sb.Append($", AccreditationNumber = {AccreditationNumber}");
            sb.Append($", YellowNumber = {YellowNumber}");
            sb.Append($", ItemName = {ItemName}");
            sb.Append($", Manufacturer = {Manufacturer}");
            sb.Append($", ModelType = {ModelType}");
            sb.Append($", ItemNatureID = {ItemNatureID}");
            sb.Append($", ItemNature = {ItemNature?.ToString()}");
            sb.Append($", ItemTypeID = {ItemTypeID}");
            sb.Append($", ItemType = {ItemType?.ToString()}");
            sb.Append($", ProductionYear = {ProductionYear?.ToShortDateString()}");
            sb.Append($", DepartmentID = {DepartmentID}");
            sb.Append($", Department = {Department?.ToString()}");
            sb.Append($", SectionID = {SectionID}");
            sb.Append($", Section = {Section?.ToString()}");
            sb.Append($", EmployeeID = {EmployeeID}");
            sb.Append($", Employee = {Employee?.ToString()}");
            sb.Append($", BuildingID = {BuildingID}");
            sb.Append($", Building = {Building?.ToString()}");
            sb.Append($", FloorID = {FloorID}");
            sb.Append($", Floor = {Floor?.ToString()}");
            sb.Append($", Room = {Room}");
            sb.Append($", ItemStateID = {ItemStateID}");
            sb.Append($", ItemState = {ItemState?.ToString()}");
            sb.Append($", DateOfCreation = {DateOfCreation?.ToShortDateString()}");
            sb.Append($", BruttoPrice = {BruttoPrice}");
            sb.Append($", DateOfScrap = {DateOfScrap?.ToShortDateString()}");
            sb.Append($", Comment = {Comment}");
            sb.Append(" }");
            return(sb.ToString());
        }