moved Common Library out of Original Repository
parent
6bfc089aeb
commit
679e252af5
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common.Library.DTO\Common.Library.DTO.csproj" />
|
||||
<ProjectReference Include="..\Common.Library\Common.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,51 @@
|
||||
using Common.Library.SQL.MySQL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using Common.Library.DTO.Websites.DMCDynamics.LLC;
|
||||
|
||||
namespace Common.Library.DAO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class CompanyInfoDAO : MySQL
|
||||
{
|
||||
public CompanyInfoDAO(string server, string database, string username, string password) : base(server, database, username, password)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public CompanyInfoDTO Select()
|
||||
{
|
||||
InitConnection();
|
||||
try
|
||||
{
|
||||
CompanyInfoDTO item = null;
|
||||
|
||||
DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
DBCommand.CommandText = "GetCompanyInfo";
|
||||
DBReader = DBCommand.ExecuteReader();
|
||||
|
||||
if(DBReader.Read())
|
||||
{
|
||||
item = new CompanyInfoDTO()
|
||||
{
|
||||
CompanyName = GetString("CompanyName"),
|
||||
Address = GetString("Address"),
|
||||
PhoneNumber = GetString("PhoneNumber"),
|
||||
EmailAddress = GetString("EmailAddress"),
|
||||
CompanySlogan = GetString("CompanySlogan")
|
||||
};
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DisposeConnection();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
using Common.Library.SQL.MySQL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using Common.Library.DTO.Websites.DMCDynamics.LLC;
|
||||
|
||||
namespace Common.Library.DAO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class ServiceInformationDAO : MySQL
|
||||
{
|
||||
public ServiceInformationDAO(string server, string database, string username, string password) : base(server, database, username, password)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ServiceInformationDTO SelectOne(int serviceID)
|
||||
{
|
||||
InitConnection();
|
||||
try
|
||||
{
|
||||
ServiceInformationDTO item = null;
|
||||
|
||||
DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
DBCommand.CommandText = "ServiceInformation_SelectOne";
|
||||
DBCommand.Parameters.AddWithValue("@ID", serviceID);
|
||||
DBReader = DBCommand.ExecuteReader();
|
||||
|
||||
if (DBReader.Read())
|
||||
{
|
||||
|
||||
item = new ServiceInformationDTO()
|
||||
{
|
||||
ServiceInformationID = GetInt("ServiceInformationID").Value,
|
||||
ServiceID = GetInt("ServiceID").Value,
|
||||
ServiceDescription = GetString("ServiceDescription")
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DisposeConnection();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
using Common.Library.SQL.MySQL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using Common.Library.DTO.Websites.DMCDynamics.LLC;
|
||||
|
||||
namespace Common.Library.DAO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class ServicesDAO : MySQL
|
||||
{
|
||||
public ServicesDAO(string server, string database, string username, string password) : base(server, database, username, password)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ServicesDTOCollection SelectAll()
|
||||
{
|
||||
InitConnection();
|
||||
try
|
||||
{
|
||||
ServicesDTOCollection items = new ServicesDTOCollection();
|
||||
|
||||
DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
DBCommand.CommandText = "GetServices";
|
||||
DBReader = DBCommand.ExecuteReader();
|
||||
|
||||
while (DBReader.Read())
|
||||
{
|
||||
|
||||
ServicesDTO item = new ServicesDTO()
|
||||
{
|
||||
ServiceID = GetInt("ServiceID").Value,
|
||||
ServiceName = GetString("ServiceName"),
|
||||
ServiceTags = GetString("ServiceTags"),
|
||||
FontAwesomeIcon = GetString("FontAwesomeIcon"),
|
||||
IsEnabled = GetBool("IsEnabled").Value
|
||||
};
|
||||
|
||||
items.Add(item);
|
||||
}
|
||||
|
||||
return (ServicesDTOCollection)(items.Count == 0 ? null : items);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DisposeConnection();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
using Common.Library.SQL.MySQL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using Common.Library.DTO.Websites.DMCDynamics.LLC;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Common.Library.DAO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class TestimonialImagesDAO : MySQL
|
||||
{
|
||||
public TestimonialImagesDAO(string server, string database, string username, string password) : base(server, database, username, password)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TestimonialImagesDTO SelectOne(int testimonialID)
|
||||
{
|
||||
InitConnection();
|
||||
try
|
||||
{
|
||||
TestimonialImagesDTO item = null;
|
||||
|
||||
DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
DBCommand.CommandText = "Testimonial_Images_SelectOne";
|
||||
DBCommand.Parameters.AddWithValue("@testimonialID", testimonialID);
|
||||
DBReader = DBCommand.ExecuteReader();
|
||||
|
||||
if (DBReader.Read())
|
||||
{
|
||||
|
||||
item = new TestimonialImagesDTO()
|
||||
{
|
||||
TestimonialImageID = GetInt("TestimonialImageID").Value,
|
||||
TestimonialID = GetInt("TestimonialID").Value,
|
||||
ImageType = GetString("ImageType"),
|
||||
ImageData = GetBytes("ImageData")
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DisposeConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertImage(int testimonialID, KeyValuePair<string, byte[]> imageData)
|
||||
{
|
||||
InitConnection();
|
||||
try
|
||||
{
|
||||
|
||||
DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
DBCommand.CommandText = "Testimonial_Images_Insert";
|
||||
|
||||
DBCommand.Parameters.AddWithValue("@testimonialID", testimonialID);
|
||||
DBCommand.Parameters.AddWithValue("@imageType", imageData.Key);
|
||||
DBCommand.Parameters.AddWithValue("@imageData", imageData.Value);
|
||||
|
||||
DBCommand.ExecuteNonQuery();
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DisposeConnection();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
using Common.Library.SQL.MySQL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using Common.Library.DTO.Websites.DMCDynamics.LLC;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Common.Library.DAO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class TestimonialsDAO : MySQL
|
||||
{
|
||||
public TestimonialsDAO(string server, string database, string username, string password) : base(server, database, username, password)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//public TestimonialImagesDTO SelectOne(int testimonialID)
|
||||
//{
|
||||
// InitConnection();
|
||||
// try
|
||||
// {
|
||||
// TestimonialImagesDTO item = null;
|
||||
|
||||
// DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
// DBCommand.CommandText = "Testimonial_Images_SelectOne";
|
||||
// DBCommand.Parameters.AddWithValue("@testimonialID", testimonialID);
|
||||
// DBReader = DBCommand.ExecuteReader();
|
||||
|
||||
// if (DBReader.Read())
|
||||
// {
|
||||
|
||||
// item = new TestimonialImagesDTO()
|
||||
// {
|
||||
// TestimonialImageID = GetInt("TestimonialImageID").Value,
|
||||
// TestimonialID = GetInt("TestimonialID").Value,
|
||||
// ImageType = GetString("ImageType"),
|
||||
// ImageData = GetBytes("ImageData")
|
||||
// };
|
||||
|
||||
// }
|
||||
|
||||
// return item;
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
// DisposeConnection();
|
||||
// }
|
||||
//}
|
||||
|
||||
public TestimonialsDTOCollection SelectAll()
|
||||
{
|
||||
InitConnection();
|
||||
try
|
||||
{
|
||||
TestimonialsDTOCollection items = new TestimonialsDTOCollection();
|
||||
|
||||
DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
DBCommand.CommandText = "Testimonials_SelectAll";
|
||||
|
||||
DBReader = DBCommand.ExecuteReader();
|
||||
|
||||
while (DBReader.Read())
|
||||
{
|
||||
|
||||
TestimonialsDTO item = new TestimonialsDTO()
|
||||
{
|
||||
TestimonialID = GetInt("TestimonialID").Value,
|
||||
CompanyName = GetString("CompanyName"),
|
||||
CompanySpokesPerson = GetString("CompanySpokesPerson"),
|
||||
CompanyTitle = GetString("CompanyTitle"),
|
||||
CompanyWebsite = GetString("CompanyWebsite"),
|
||||
Testimonial = GetString("Testimonial")
|
||||
};
|
||||
|
||||
items.Add(item);
|
||||
|
||||
}
|
||||
|
||||
return (TestimonialsDTOCollection)(items.Count == 0 ? null : items);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DisposeConnection();
|
||||
}
|
||||
}
|
||||
|
||||
//public void InsertImage(int testimonialID, KeyValuePair<string, byte[]> imageData)
|
||||
//{
|
||||
// InitConnection();
|
||||
// try
|
||||
// {
|
||||
|
||||
// DBCommand.CommandType = CommandType.StoredProcedure;
|
||||
// DBCommand.CommandText = "Testimonial_Images_Insert";
|
||||
|
||||
// DBCommand.Parameters.AddWithValue("@testimonialID", testimonialID);
|
||||
// DBCommand.Parameters.AddWithValue("@imageType", imageData.Key);
|
||||
// DBCommand.Parameters.AddWithValue("@imageData", imageData.Value);
|
||||
|
||||
// DBCommand.ExecuteNonQuery();
|
||||
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// throw;
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
// DisposeConnection();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common.Library\Common.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,49 @@
|
||||
using System.Collections.Generic;
|
||||
using Common.Library.CustomObjects;
|
||||
using System.Linq;
|
||||
|
||||
namespace Common.Library.DTO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class CompanyInfoDTO
|
||||
{
|
||||
public string CompanyName { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string EmailAddress { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string CompanySlogan { get; set; }
|
||||
|
||||
public PhoneNumberContainer FormattedPhoneNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
List<string> phoneNumber = PhoneNumber.Split(" ").Select(val => val.Trim()).ToList<string>();
|
||||
return new PhoneNumberContainer { AreaCode = phoneNumber[0], PhoneNumber = phoneNumber[1] };
|
||||
}
|
||||
}
|
||||
|
||||
public AddressContainer FormattedAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
List<string> address = Address.Split(",").Select(val => val.Trim()).ToList<string>();
|
||||
|
||||
string houseNumber = address[0].Substring(0, address[0].IndexOf(" ")).Trim();
|
||||
string streetName = address[0].Substring(address[0].IndexOf(" ")).Trim();
|
||||
string city = address[1].Trim();
|
||||
string state = address[2].Substring(0, address[2].IndexOf(" ")).Trim();
|
||||
string zip = address[2].Substring(address[2].IndexOf(" ")).Trim();
|
||||
|
||||
return new AddressContainer
|
||||
{
|
||||
HouseNumber = houseNumber,
|
||||
StreetName = streetName,
|
||||
City = city,
|
||||
State = state,
|
||||
Zip = zip
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CompanyInfoDTOCollection : List<CompanyInfoDTO> { }
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Common.Library.DTO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class ServiceInformationDTO
|
||||
{
|
||||
public int ServiceInformationID { get; set; }
|
||||
public int ServiceID { get; set; }
|
||||
public string ServiceDescription { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class ServiceInformationDTOCollection : List<ServiceInformationDTO> {}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Common.Library.DTO.Websites.DMCDynamics.LLC
|
||||
{
|
||||
public class ServicesDTO
|
||||
{
|
||||
public int ServiceID { get; set; }
|
||||
public string ServiceName { get; set; }
|
||||
public string ServiceTags { get; set; }
|
||||
public string FontAwesomeIcon { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
|
||||
public class ServicesDTOCollection : List<ServicesDTO> {}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common.Library\Common.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Binary file not shown.
After Width: | Height: | Size: 225 KiB |
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace Common.Library.Tests
|
||||
{
|
||||
public class ImageHandlingTests
|
||||
{
|
||||
[Fact]
|
||||
public void ImageConversionTest()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.7" />
|
||||
<PackageReference Include="MySql.Data" Version="8.0.21" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,78 @@
|
||||
using System;
|
||||
|
||||
namespace Common.Library.SQL.Base
|
||||
{
|
||||
public abstract class SQLBase : IDisposable
|
||||
{
|
||||
protected DBConnectionInformation DBConnectionInfo;
|
||||
|
||||
protected enum DBType
|
||||
{
|
||||
MSSQL,
|
||||
MYSQL
|
||||
}
|
||||
protected struct DBConnectionInformation
|
||||
{
|
||||
public string DBHost {get;set;}
|
||||
public string DBName {get;set;}
|
||||
public string DBUserName {get;set;}
|
||||
public string DBPassword {get;set;}
|
||||
public DBType DBType {get;set;}
|
||||
|
||||
public string GetConnectionString()
|
||||
{
|
||||
string rv = string.Empty;
|
||||
|
||||
switch(DBType)
|
||||
{
|
||||
case DBType.MSSQL:
|
||||
break;
|
||||
case DBType.MYSQL:
|
||||
rv = string.Format("Server={0};Database={1};Uid={2};Pwd={3}", DBHost, DBName, DBUserName, DBPassword);
|
||||
break;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// free managed resources
|
||||
}
|
||||
// free native resources if there are any.
|
||||
}
|
||||
|
||||
protected abstract void InitConnection();
|
||||
protected abstract void DisposeConnection();
|
||||
|
||||
protected abstract int GetOrdinal(string columnName);
|
||||
protected abstract int? GetInt(int columnID);
|
||||
protected abstract int? GetInt(string columnName);
|
||||
protected abstract byte? GetByte(int columnID);
|
||||
protected abstract byte? GetByte(string columnName);
|
||||
protected abstract byte[] GetBytes(int columnID);
|
||||
protected abstract byte[] GetBytes(string columnName);
|
||||
protected abstract decimal? GetDecimal(int columnID);
|
||||
protected abstract decimal? GetDecimal(string columnName);
|
||||
protected abstract long? GetLong(int columnID);
|
||||
protected abstract long? GetLong(string columnName);
|
||||
protected abstract short? GetShort(int columnID);
|
||||
protected abstract short? GetShort(string columnName);
|
||||
protected abstract string GetString(int columnID);
|
||||
protected abstract string GetString(string columnName);
|
||||
protected abstract bool? GetBool(int columnID);
|
||||
protected abstract bool? GetBool(string columnName);
|
||||
protected abstract DateTime? GetDateTime(int columnID);
|
||||
protected abstract DateTime? GetDateTime(string columnName);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
CREATE DATABASE IF NOT EXISTS dmcdynamics;
|
||||
CREATE USER 'dmcdynamics'@'localhost' IDENTIFIED BY 'Iu5I03ZDYjtYtqfD';
|
||||
GRANT ALL ON dmcdynamics.* TO 'dmcdynamics'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
CREATE TABLE `companyinfo` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`CompanyName` varchar(255) NOT NULL,
|
||||
`PhoneNumber` varchar(20) NOT NULL,
|
||||
`EmailAddress` varchar(100) NOT NULL,
|
||||
`Address` varchar(255) NOT NULL,
|
||||
`CompanySlogan` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ;
|
||||
|
||||
INSERT INTO `CompanyInfo`
|
||||
(
|
||||
CompanyName,
|
||||
PhoneNumber,
|
||||
EmailAddress,
|
||||
Address
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'DMC Dynamics LLC',
|
||||
'(224) 241-2285',
|
||||
'jobs@dmcdynamics.llc',
|
||||
'4600 Sycamore Ln, Rolling Meadows, IL 60008'
|
||||
);
|
||||
|
||||
DROP PROCEDURE IF EXISTS dmcdynamics.GetCompanyInfo;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE PROCEDURE dmcdynamics.GetCompanyInfo()
|
||||
begin
|
||||
SELECT CompanyName,
|
||||
PhoneNumber,
|
||||
EmailAddress,
|
||||
Address,
|
||||
CompanySlogan
|
||||
FROM `CompanyInfo`
|
||||
LIMIT 1;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
CREATE TABLE `services` (
|
||||
`ServiceID` int NOT NULL AUTO_INCREMENT,
|
||||
`ServiceName` varchar(255) NOT NULL,
|
||||
`ServiceTags` varchar(255) NULL,
|
||||
`FontAwesomeIcon` varchar(50) NOT NULL,
|
||||
`IsEnabled` bit(1) NOT NULL DEFAULT b'1',
|
||||
PRIMARY KEY (`ServiceID`)
|
||||
);
|
||||
|
||||
INSERT INTO `Services` (ServiceName) VALUES ('Software Development');
|
||||
INSERT INTO `Services` (ServiceName) VALUES ('Web Design & Hosting');
|
||||
INSERT INTO `Services` (ServiceName) VALUES ('Custom Computers');
|
||||
INSERT INTO `Services` (ServiceName) VALUES ('Resume Services');
|
||||
INSERT INTO `Services` (ServiceName) VALUES ('VHS to DVD Conversion');
|
||||
INSERT INTO `Services` (ServiceName) VALUES ('Tech Consulting');
|
||||
|
||||
DROP PROCEDURE IF EXISTS dmcdynamics.GetServices;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE PROCEDURE dmcdynamics.GetServices()
|
||||
begin
|
||||
SELECT ServiceID,
|
||||
ServiceName,
|
||||
ServiceTags,
|
||||
FontAwesomeIcon,
|
||||
IsEnabled
|
||||
FROM `Services`
|
||||
WHERE IsEnabled = 1;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
CREATE TABLE dmcdynamics.`service-information` (
|
||||
ServiceInformationID INT auto_increment NOT NULL,
|
||||
ServiceID INT NOT NULL,
|
||||
ServiceDescription varchar(1000) NOT NULL,
|
||||
CONSTRAINT service_information_pk PRIMARY KEY (ServiceInformationID),
|
||||
CONSTRAINT service_information_ServiceID_FK FOREIGN KEY (ServiceID) REFERENCES dmcdynamics.services(ServiceID)
|
||||
)
|
||||
|
||||
DROP PROCEDURE IF EXISTS dmcdynamics.ServiceInformation_SelectOne;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE PROCEDURE dmcdynamics.ServiceInformation_SelectOne(
|
||||
IN ID INT
|
||||
)
|
||||
BEGIN
|
||||
SELECT ServiceInformationID,
|
||||
ServiceID,
|
||||
ServiceDescription
|
||||
FROM `dmcdynamics`.`service-information`
|
||||
WHERE ServiceID = ID;
|
||||
END$$
|
||||
DELIMITER ;
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue