public static string ManageMotorcycle(NameValueCollection querystring) { int intParser; decimal decimalParser; DateTime dateTimeParser; var mc = new Motorcycle { ID = int.TryParse(querystring.Get("MotorcycleID"), out intParser) ? intParser : 0, Branch = int.TryParse(querystring.Get("BranchID"), out intParser) ? intParser : 0, MCCode = querystring.Get("Code"), MC = querystring.Get("Description"), EngineNo = querystring.Get("EngineNo"), ChassisNo = querystring.Get("ChassisNo"), Srp = decimal.TryParse(querystring.Get("SRP"), out decimalParser) ? decimalParser : 0, DateEffective = DateTime.TryParse(querystring.Get("EffectiveDate"), out dateTimeParser) ? dateTimeParser.ToShortDateString() : "", Cost = decimal.TryParse(querystring.Get("InventoryCost"), out decimalParser) ? decimalParser : 0, CountRepo = int.TryParse(querystring.Get("CountRepo"), out intParser) ? intParser : 0 }; string isInsert = querystring.Get("TransType"); string param = WebCommon.ToXML(mc); return(MotorcycleDAL.ManageMC(param, isInsert)); }
public static MCInventory[] GetInventoryCot(NameValueCollection querystring) { MCInventory[] inventoryCost = null; int InventoryID = int.TryParse(querystring.Get("InventoryID"), out InventoryID) ? InventoryID : 0; try { inventoryCost = MotorcycleDAL.GetInventoryCost(InventoryID); } catch (Exception ex) { string toemail; toemail = ex.Message; } return(inventoryCost); }
public static Motorcycle[] GetMotorcycle(NameValueCollection querystring) { Motorcycle[] motorcycles = null; string criteria = querystring.Get("Criteria"); int branchID = int.TryParse(querystring.Get("BranchID"), out branchID) ? branchID : 0; try { motorcycles = MotorcycleDAL.GetMotorcycle(criteria, branchID); } catch (Exception ex) { string toemail; toemail = ex.Message; } return(motorcycles); }