Esempio n. 1
0
        public override string ToString()
        {
            var faceToString = EnumExtension.Description(this.Face);
            var siutToString = EnumExtension.Description(this.Suit);

            return(faceToString + siutToString);
        }
Esempio n. 2
0
        public SoftRedactor()
        {
            InitializeComponent();

            _Type.Items.Add(EnumExtension.Description <TypeSoftware>(TypeSoftware.OS));
            _Type.Items.Add(EnumExtension.Description <TypeSoftware>(TypeSoftware.Redactor));
            _Type.Items.Add(EnumExtension.Description <TypeSoftware>(TypeSoftware.CAD));

            _LicenseForm.Items.Add(EnumExtension.Description <TypeLicenseForm>(TypeLicenseForm.Commerc));
            _LicenseForm.Items.Add(EnumExtension.Description <TypeLicenseForm>(TypeLicenseForm.Free));
            _LicenseForm.Items.Add(EnumExtension.Description <TypeLicenseForm>(TypeLicenseForm.Open));
            _LicenseForm.Items.Add(EnumExtension.Description <TypeLicenseForm>(TypeLicenseForm.ShareWare));
        }
Esempio n. 3
0
 public InputDevices Update(InputDevices updateResources)
 {
     using (var sqlConnection = new SqlConnection(_connectionString))
     {
         sqlConnection.Open();
         using (var sqlCommand = sqlConnection.CreateCommand())
         {
             sqlCommand.CommandText = "InputDevices_Update";
             sqlCommand.CommandType = CommandType.StoredProcedure;
             sqlCommand.Parameters.AddWithValue("@Type", EnumExtension.Description <TypeInputDevices>(updateResources.Type));
             sqlCommand.Parameters.AddWithValue("@Price", updateResources.Price);
             sqlCommand.ExecuteNonQuery();
             return(updateResources);
         }
     }
 }
Esempio n. 4
0
 public InputDevices Create(InputDevices newResources)
 {
     using (var sqlConnection = new SqlConnection(_connectionString))
     {
         sqlConnection.Open();
         using (var sqlCommand = sqlConnection.CreateCommand())
         {
             sqlCommand.CommandText = "InputDevices_Create";
             sqlCommand.CommandType = CommandType.StoredProcedure;
             sqlCommand.Parameters.AddWithValue("@Type", EnumExtension.Description <TypeInputDevices>(newResources.Type));
             sqlCommand.Parameters.AddWithValue("@Price", newResources.Price);
             var result = newResources;
             result.ID = Convert.ToInt16(sqlCommand.ExecuteScalar());
             return(result);
         }
     }
 }
Esempio n. 5
0
 public InformationSupport Update(InformationSupport updateResources)
 {
     using (var sqlConnection = new SqlConnection(_connectionString))
     {
         sqlConnection.Open();
         using (var sqlCommand = sqlConnection.CreateCommand())
         {
             sqlCommand.CommandText = "Resources.InformationSupports_Update";
             sqlCommand.CommandType = CommandType.StoredProcedure;
             sqlCommand.Parameters.AddWithValue("@InformationSupportId", updateResources.ID);
             sqlCommand.Parameters.AddWithValue("@MultiClientUse", updateResources.MultiClientUse);
             sqlCommand.Parameters.AddWithValue("@Type", EnumExtension.Description <TypeIS>(updateResources.Type));
             sqlCommand.Parameters.AddWithValue("@Price", updateResources.Price);
             sqlCommand.ExecuteNonQuery();
             return(updateResources);
         }
     }
 }
Esempio n. 6
0
 public Software Update(Software updateResources)
 {
     using (var sqlConnection = new SqlConnection(_connectionString))
     {
         sqlConnection.Open();
         using (var sqlCommand = sqlConnection.CreateCommand())
         {
             sqlCommand.CommandText = "Resources.Softwares_Update";
             sqlCommand.CommandType = CommandType.StoredProcedure;
             sqlCommand.Parameters.AddWithValue("@SoftwareId", updateResources.ID);
             sqlCommand.Parameters.AddWithValue("@Type", EnumExtension.Description <TypeSoftware>(updateResources.Type));
             sqlCommand.Parameters.AddWithValue("@Name", updateResources.Name);
             sqlCommand.Parameters.AddWithValue("@LicenseForm", EnumExtension.Description <TypeLicenseForm>(updateResources.LicenseForm));
             sqlCommand.Parameters.AddWithValue("@LicenseStatus", updateResources.LicenseStatus);
             sqlCommand.Parameters.AddWithValue("@Price", updateResources.Price);
             sqlCommand.ExecuteNonQuery();
             return(updateResources);
         }
     }
 }
Esempio n. 7
0
 public Software Create(Software newResources)
 {
     using (var sqlConnection = new SqlConnection(_connectionString))
     {
         sqlConnection.Open();
         using (var sqlCommand = sqlConnection.CreateCommand())
         {
             sqlCommand.CommandText = "Resources.Softwares_Create";
             sqlCommand.CommandType = CommandType.StoredProcedure;
             sqlCommand.Parameters.AddWithValue("@Type", EnumExtension.Description <TypeSoftware>(newResources.Type));
             sqlCommand.Parameters.AddWithValue("@Name", newResources.Name);
             sqlCommand.Parameters.AddWithValue("@LicenseForm", EnumExtension.Description <TypeLicenseForm>(newResources.LicenseForm));
             sqlCommand.Parameters.AddWithValue("@LicenseStatus", newResources.LicenseStatus.ToString());
             sqlCommand.Parameters.AddWithValue("@Price", newResources.Price);
             var result = newResources;
             result.ID = Convert.ToInt16(sqlCommand.ExecuteScalar());
             return(result);
         }
     }
 }