protected void Load_ProductType() { int productId = Convert.ToInt32(Request.QueryString["ID"]); ProductType prk = ProductTypeRepo.GetProductTypeByID(productId); TableRow newRow = new TableRow(); ProductTypeTable.Controls.Add(newRow); TableCell productTypeCell = new TableCell(); productTypeCell.Controls.Add(new Label() { Text = prk.Name }); newRow.Cells.Add(productTypeCell); TableCell productDescCell = new TableCell(); productDescCell.Controls.Add(new Label() { Text = prk.Description }); newRow.Cells.Add(productDescCell); }
protected void btnSubmit_Click(object sender, EventArgs e) { ProductTypeRepo repo = new ProductTypeRepo(); ProductTypeModel productTypeModel = CreateProductType(); lblResult.Text = repo.InsertProductType(productTypeModel); }
public static Boolean checkProductTypeIsUnique(string Name) { ProductType pt = ProductTypeRepo.getByName(Name); if (pt != null) { return(false); } else { return(true); } }
public static Boolean checkIfInsertedProductTypeIDValid(int ID) { ProductType pt = ProductTypeRepo.get(ID); if (pt == null) { return(false); } else { return(true); } }
protected void ddlProductType_SelectedIndexChanged(object sender, EventArgs e) { ProductType productType = new ProductTypeRepo().GetById(ToSQL.SQLToInt(ddlProductType.SelectedValue)); if (productType != null) { CKEditorControlDescription.Text = productType.DescriptionTemplate; } else { CKEditorControlDescription.Text = ""; } }
private void LoadDropDownList() { List <ProductType> ProductTypes = new ProductTypeRepo().GetAllProductType(); ddlProductType.DataSource = ProductTypes; ddlProductType.DataBind(); ddlProductType.Items.Insert(0, new ListItem("(All)", "")); List <Manufacturer> Manufacturers = new ManufacturerRepo().GetAllManufacturer(); ddlManufacturer.DataSource = Manufacturers; ddlManufacturer.DataBind(); ddlManufacturer.Items.Insert(0, new ListItem("(All)", "")); }
public static Boolean checkIfProductTypeIDValid(int ID) { ProductType pt = ProductTypeRepo.get(ID); Product product = ProductRepo.getByProductTypeID(ID); if (pt == null || product != null) { return(false); } else { return(true); } }
protected void lnkRemove_Click(object sender, EventArgs e) { try { LinkButton lnk = (LinkButton)sender; int Id = ToSQL.SQLToInt(lnk.CommandArgument); if (Id > 0) { int i = new ProductTypeRepo().DeleteProductType(Id); BindItemsList(); } } catch { } }
protected void Load_ProductsType() { List <ProductType> productTypeList = ProductTypeRepo.GetProductType(); for (int i = 0; i < productTypeList.Count; i++) { TableRow newRow = new TableRow(); ProductTypeTable.Controls.Add(newRow); TableCell productTypeIdCell = new TableCell(); productTypeIdCell.Controls.Add(new Label() { Text = productTypeList.ElementAt(i).ID.ToString() }); newRow.Cells.Add(productTypeIdCell); TableCell productTypeNameCell = new TableCell(); productTypeNameCell.Controls.Add(new Label() { Text = productTypeList.ElementAt(i).Name }); newRow.Cells.Add(productTypeNameCell); } }
public static int getLastProductTypeID() { return(ProductTypeRepo.getLastProductTypeID()); }
public ProductTypeController(ProductTypeRepo repository) { _repository = repository; }
public static void remove(int ID) { ProductTypeRepo.remove(ProductTypeRepo.get(ID)); }
public UnitOfWork(GMartDbContext gMartDbContext)//gmartdbcontext added for DI by gmartui startup configureservices { _gMartDbContext = gMartDbContext; productRepository = new ProductRepository(_gMartDbContext); productTypeRepo = new ProductTypeRepo(_gMartDbContext); }
public static string getProductType(int ID) { ProductType pt = ProductTypeRepo.getProductType(ID); return(pt.Name); }
public static List <ProductType> getAllProductType() { return(ProductTypeRepo.GetProductType()); }
public static void doUpdateProductType(int id, string productTypeName, string description) { ProductTypeRepo.Update(id, productTypeName, description); }
public static ProductType getProductTypeByName(string name) { return(ProductTypeRepo.getProductTypeByName(name)); }
public static ProductType getProductTypeById(int id) { return(ProductTypeRepo.GetProductTypeByID(id)); }
public static void insertProductType(String Name, String Description) { ProductTypeRepo.insertProductType(ProductTypeFactory.createProductType(Name, Description)); }
public static void doCreateProductType(string productTypeName, string description) { ProductTypeRepo.Create(productTypeName, description); }
public static ProductType get(int ID) { return(ProductTypeRepo.get(ID)); }
public static void doDeleteProductType(int id) { ProductTypeRepo.Delete(id); }
public static void updateProductType(int ID, String Name, String Description) { ProductTypeRepo.updateProductType(ID, Name, Description); }