Example #1
0
 private void buttonSubmit_Click(object sender, EventArgs e)
 {
     if (procesor == null || video == null)
     {
         MessageBox.Show("You need to set processor and videocard first");
     }
     else
     {
         try
         {
             int          memory      = Helper.GetIntValue(textMemorySize);
             int          driveSize   = Helper.GetIntValue(textDriveSize);
             DateTime     datePurchse = datePurchaseDate.Value;
             ComputerType compType    = GetComputerType();
             RAMType      ramType     = GetRAMType();
             DriveType    driveType   = GetDriveType();
             comp = new Computer(compType, procesor, video, ramType, driveSize, driveType, datePurchse, memory);
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         catch (FormValueError ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
Example #2
0
 public override string ToString()
 {
     return($"PC Info:\n\t>>> Processor: {Processor} - {ProcessorInGHz} GHz - {ProcessorCount} cores.\n\t" +
            $">>> RAM: {RAMType.ToString()} {RAMSizeInGb} Gb.\n\t" +
            $">>> Graphics card: {GraphicsCard.ToString()} {GraphicsCardMemoryInMb} Mb.\n\t" +
            $">>> Hard Disk: {HardDiskType.ToString()} {HardDiskSizeInGb} Gb.\n\t" +
            $">>> OS: {OperatingSystemType.ToString()} {OperatingSystemVersion}.");
 }
        //[ValidateAntiForgeryToken]
        public IActionResult Create(RAMTypeViewModel model)
        {
            var ramType = new RAMType()
            {
                Name = model.Name
            };

            var result = _ramTypeService.CreateRAMType(ramType);

            if (result.Succedeed)
            {
                return(Json(ramType));
            }

            return(Json(result));
        }
Example #4
0
    public float memory; // in MBs

    public RAM(string modelName, string manufacturer, float malfunctionRate, float cost, RAMType type, float memory, bool isMantadory) : base(modelName, manufacturer, malfunctionRate, cost)
    {
        this.memory = memory;
        this.type   = type;
    }
Example #5
0
 public OperationDetails CreateRAMType(RAMType ramType)
 {
     Database.RAMTypes.Create(ramType);
     Database.Save();
     return(new OperationDetails(true, "Ok", ""));
 }
Example #6
0
 public RAM(string n, string m, RAMType t)
 {
     name = n; manufacturer = m; type = t;
 }