This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the parent categories | |
List<APICategory> parent_cats = CURTAPI.GetParentCategories(); | |
foreach (APICategory parent in parent_cats) { | |
List<APICategory> subs = CURTAPI.GetSubCategories(parent.catID); | |
parent.sub_categories = subs; | |
} | |
ViewBag.parent_cats = parent_cats; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prepare all MySQL statements | |
func PrepareAll() error { | |
UnPreparedStatements := make(map[string]string, 0) | |
UnPreparedStatements["authenticateUserStmt"] = "select * from user where username=? and encpassword=? and isActive = 1" | |
UnPreparedStatements["getUserByIDStmt"] = "select * from user where id=?" | |
UnPreparedStatements["getUserByUsernameStmt"] = "select * from user where username=?" | |
UnPreparedStatements["getUserByEmailStmt"] = "select * from user where email=?" | |
UnPreparedStatements["allUserStmt"] = "select * from user" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Image i = null; | |
int tries = 0; | |
while (i == null) { | |
try { | |
i = Image.FromFile(server.MapPath(file)); | |
} catch { | |
// image failed to map | |
} | |
tries++; | |
if (tries >= 10) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE CurtDev; | |
GO | |
DECLARE @id AS int; | |
--Create new ContentID for every T-Connector part in the Content table | |
--use last inserted identity value as variable, id | |
INSERT INTO Content(text, cTypeID) | |
VALUES ('Simple plug and play design eliminates the need for cutting or splicing', 2); | |
SET @id = (SELECT @@IDENTITY); | |
GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE Theme ( | |
ID int IDENTITY(1,1) PRIMARY KEY NOT NULL, | |
name varchar(255) NULL, | |
active bit NOT NULL, | |
dateAdded datetime NOT NULL | |
) | |
GO | |
CREATE TABLE ThemeFileType ( | |
ID int IDENTITY(1,1) PRIMARY KEY NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parts = (from p in db.Parts | |
join ci in db.CartIntegrations on p.partID equals ci.partID | |
join cu in db.Customers on ci.custID equals cu.customerID | |
join c in db.Classes on p.classID equals c.classID into ClassTemp | |
from c in ClassTemp.DefaultIfEmpty() | |
where p.featured == true && statuslist.Contains(p.status) && cu.customerID.Equals(customerID) && ci.custPartID > 0 | |
orderby p.dateModified descending | |
select new APIPart { | |
partID = p.partID, | |
custPartID = ci.custPartID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use CurtDev; | |
select bv.YearID, ma.MakeName, mo.ModelName, sm.SubmodelName, | |
(select GROUP_CONCAT(ca.value) as combined | |
from VehicleConfigAttribute vca | |
inner join ConfigAttribute ca ON vca.AttributeID = ca.ID | |
where vca.ID in (select vca1.AttributeID FROM VehicleConfigAttribute vca1 where vca1.VehicleConfigID = v.ConfigID) | |
) as Config | |
from BaseVehicle bv | |
join vcdb_Vehicle v on bv.ID = v.BaseVehicleID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context.MapRoute( | |
"v2API2", | |
"v2/{action}/{id}", | |
new { controller = "v2", id = UrlParameter.Optional } | |
); | |
context.MapRoute( | |
"ordersAPI", | |
"orders/{action}/{id}", | |
new { controller = "orders", id = UrlParameter.Optional } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes.MapRoute( | |
name: "Mount", | |
url: "HitchLookup/Mount/{mount}", | |
defaults: new { controller = "HitchLookup", action = "Mount", mount = "" } | |
); | |
routes.MapRoute( | |
name: "Year", | |
url: "HitchLookup/Mount/{mount}/Year/{year}", | |
defaults: new { controller = "HitchLookup", action = "Year", year = "", mount = "" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes.MapRoute( | |
name: "NameOfRoute", | |
url: "v2/{action}/{id}", | |
defaults: new { controller = "v2", id = UrlParameter.Optional }, | |
constraints: null, | |
namespaces: new[] { "App.Areas.Blah.Controllers" } | |
); |