public List <ProductType> getAllProductTypes() { SqlHelper helper = new SqlHelper(); ProductTypeDAL dal = new ProductTypeDAL(helper); var types = dal.getAllProductType(); helper.Close(); return(types); }
public static bool database(string id) { int b = ProductTypeDAL.database(id); if (b >= 1) { return(true); } else { return(false); } }
protected void Page_Load(object sender, EventArgs e) { var dal = new ProductTypeDAL(); bool isSuccess = dal.Add(new ProductType { Brand = "Test品牌", Spec = "Spec", TypeCode1 = "TypeCode1", TypeCode2 = "TypeCode2", TypeName1 = "TypeName1", TypeName2 = "TypeName2" }); }
public static bool insert(string name) { int b = ProductTypeDAL.insert(name); if (b >= 1) { return(true); } else { return(false); } }
public static bool update(string id, string name) { int b = ProductTypeDAL.update(id, name); if (b >= 1) { return(true); } else { return(false); } }
public void createInvoice(Record document) { if (SafeUser != null && SafeUser.isLoggedIn()) { try { SqlHelper helper = new SqlHelper(); SecurityDAL sdal = new SecurityDAL(helper); if (sdal.hasPermission(SafeUser.SignIN.UID, "UPDATE") && sdal.hasPermission(SafeUser.SignIN.UID, "DELETE")) { ProductInventoryDAL piDAL = new ProductInventoryDAL(helper); ProductDocumentDAL pdDAL = new ProductDocumentDAL(helper); ProductTypeDAL ptDAL = new ProductTypeDAL(helper); InventoryDocumentationDAL idDAL = new InventoryDocumentationDAL(helper); ProductType type = ptDAL.getProductType(document.ProductType); if (type == null) { ptDAL.addProductType(document.ProductType); type = ptDAL.getProductType(document.ProductType); } ProductInventory product = piDAL.getProduct(document.ProductName, type.TID); if (product != null && product.TotalQuantity - document.ProductQuantity >= 0) { product.TotalQuantity += document.ProductQuantity; piDAL.updateProduct(product); } else { log(404, "No such product"); return; } ProductDocument delivery = new ProductDocument(); delivery.Name = document.DocumentName; delivery.PrID = product.PrID; delivery.Description = document.Description; delivery.Quantity = document.ProductQuantity; pdDAL.addDocument(delivery); delivery = pdDAL.getDocument(document.DocumentName, product.PrID, document.ProductQuantity, document.Description); idDAL.assignDocument(SafeUser.SignIN.UID, delivery.DocumentID); } }catch (Exception ex) { log(ex); } } }
public void AddTest() { var dal = new ProductTypeDAL(); bool isSuccess = dal.Add(new ProductType { Brand = "Test品牌", Spec = "Spec", TypeCode1 = "TypeCode1", TypeCode2 = "TypeCode2", TypeName1 = "TypeName1", TypeName2 = "TypeName2" }); Assert.IsTrue(isSuccess); }
/// <summary> /// Judge the ProductTypeId whether exist by Id before delete or update /// </summary> /// <param name="Id">Id</param> /// <returns>Return the counts of the ProductType by Id</returns> public static int ProductTypeIdIsExist(int Id) { return(ProductTypeDAL.ProductTypeIdIsExist(Id)); }
/// <summary> /// Out to excel the all data of ProductType /// </summary> /// <returns>Return DataTable Object</returns> public static DataTable OutToExcel_ProductType() { return(ProductTypeDAL.OutToExcel_ProductType()); }
/// <summary> /// 删除商品类型 /// </summary> /// <param name="p">房间类型对象</param> /// <returns>受影响的行数</returns> public static int DeleteProductType(ProductTypeMDL p) { return(ProductTypeDAL.DeleteProductType(p)); }
/// <summary> /// Judge the ProductTypeId whether has operation before delete by Id /// </summary> /// <param name="Id">Id</param> /// <returns>Return the counts of the ProductType by Id</returns> public static int ProductTypeIdWhetherHasOperation(int Id) { return(ProductTypeDAL.ProductTypeIdWhetherHasOperation(Id)); }
/// <summary> /// 添加产品类别 /// </summary> /// <param name="item"></param> /// <returns></returns> public int AddItem(ProductType item) { return(ProductTypeDAL.AddItem(item)); }
/// <summary> /// 修改商品类型 /// </summary> /// <param name="p"></param> /// <returns></returns> public static int AlterProductType(ProductTypeMDL p) { return(ProductTypeDAL.AlterProductType(p)); }
/// <summary> /// 获取指定产品型号行数 /// </summary> /// <param name="productTypeID">产品型号ID</param> /// <param name="productTypeName">产品型号名称</param> /// <returns>返回获取指定产品型号行数</returns> public static int GetProductTypeCountByIDName(int productTypeID, string productTypeName) { return(ProductTypeDAL.GetProductTypeCountByIDName(productTypeID, productTypeName)); }
/// <summary> /// 获取产品类型信息 /// </summary> /// <returns>返回DataTable对象</returns> public static DataTable GetProductTypeInfo() { return(ProductTypeDAL.GetProductTypeInfo()); }
/// <summary> /// 获取产品型号名称 /// </summary> /// <param name="productTypeID">产品型号ID</param> /// <returns>返回产品型号名称</returns> public static string GetProductTypeNameByID(int productTypeID) { return(ProductTypeDAL.GetProductTypeNameByID(productTypeID)); }
/// <summary> /// 获取指定产品型号行数 /// </summary> /// <param name="productTypeName">产品型号名称</param> /// <returns>返回获取指定产品型号行数</returns> public static int GetProductTypeCountByName(string productTypeName) { return(ProductTypeDAL.GetProductTypeCountByName(productTypeName)); }
public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName) { Type controllerType = Type.GetType(string.Concat(_controllerNamespace, ".", controllerName, "Controller")); dynamic service = new CustomerProductDAL(); switch (controllerName) { case "CustomerProducts": { service = new CustomerProductDAL(); break; } case "Orders": { service = new OrderDAL(); break; } case "Home": { service = new DashBoardDAL(); break; } case "Categories": { service = new CategoryDAL(); break; } case "Products": { service = new ProductDAL(); break; } case "BulkBuys": { service = new BulkBuyDAL(); break; } case "Buyers": { service = new BuyerDAL(); break; } case "Sellers": { service = new SellerDAL(); break; } case "Borrowers": { service = new BorrowerDAL(); break; } case "ProductTypes": { service = new ProductTypeDAL(); break; } case "Customers": { service = new CustomerDAL(); break; } case "Account": { service = new AccountDAL(); break; } case "Manage": { service = new ManageDAL(); break; } case "Vendors": { service = new VendorDAL(); break; } } IController controller = Activator.CreateInstance(controllerType, new[] { service }) as Controller; return(controller); }
/// <summary> /// 删除产品类别 /// </summary> /// <param name="id">id</param> /// <returns></returns> public int DeleteItem(int id) { return(ProductTypeDAL.DeleteItem(id)); }
/// <summary> /// 修改产品类别 /// </summary> /// <param name="item"></param> /// <returns></returns> public int UpdateItem(ProductType item) { return(ProductTypeDAL.UpdateItem(item)); }
/// <summary> /// 删除指定产品型号信息 /// </summary> /// <param name="productTypeID">产品型号ID</param> /// <returns>返回删除指定产品型号信息所影响的行数</returns> public static int DelProductTypeByID(int productTypeID) { return(ProductTypeDAL.DelProductTypeByID(productTypeID)); }
/// <summary> /// 获取实体对象 /// </summary> /// <param name="id">产品类别ID</param> /// <returns></returns> public ProductType GetItem(int id) { return(ProductTypeDAL.GetItem(id)); }
/// <summary> /// 更新指定产品模型信息 /// </summary> /// <param name="productType">产品型号模型</param> /// <returns>返回更新指定产品模型信息所影响的行数</returns> public static int UpdProductTypeByID(ProductTypeModel productType) { return(ProductTypeDAL.UpdProductTypeByID(productType)); }
/// <summary> /// combox高级绑定 /// </summary> /// <returns></returns> public static DataTable selectcombox() { return(ProductTypeDAL.selectcombox()); }
/// <summary> /// 获取指定产品类型信息 /// </summary> /// <param name="productTypeID">产品型号ID</param> /// <returns>返回DataTable对象</returns> public static DataTable GetProductTypeInfoByID(int productTypeID) { return(ProductTypeDAL.GetProductTypeInfoByID(productTypeID)); }
public string GetTypeNameById(int typeid) { ProductType item = ProductTypeDAL.GetItem(typeid); return(item != null ? item.TypeName : ""); }
/// <summary> /// 向产品型号表中插入相关记录 /// </summary> /// <param name="productType">产品型号模型</param> /// <returns>返回向产品型号表中插入相关记录所影响的行数</returns> public static int AddProductType(ProductTypeModel productType) { return(ProductTypeDAL.AddProductType(productType)); }
public ProductTypeController(ApplicationDbContext _context, IWebHostEnvironment _env) { DAL = new ProductTypeDAL(_context); context = _context; env = _env; }
public ProductTypeController() { DAL = new ProductTypeDAL(); context = new ApplicationDbContext(); }
/// <summary> /// 查询商品类型 /// </summary> public static List <ProductTypeMDL> selectProductType() { return(ProductTypeDAL.selectProductType()); }