コード例 #1
0
        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);
        }
コード例 #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ProductTypeRepo  repo             = new ProductTypeRepo();
            ProductTypeModel productTypeModel = CreateProductType();

            lblResult.Text = repo.InsertProductType(productTypeModel);
        }
コード例 #3
0
        public static Boolean checkProductTypeIsUnique(string Name)
        {
            ProductType pt = ProductTypeRepo.getByName(Name);

            if (pt != null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #4
0
        public static Boolean checkIfInsertedProductTypeIDValid(int ID)
        {
            ProductType pt = ProductTypeRepo.get(ID);

            if (pt == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #5
0
        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 = "";
            }
        }
コード例 #6
0
        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)", ""));
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
 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
     {
     }
 }
コード例 #9
0
        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);
            }
        }
コード例 #10
0
 public static int getLastProductTypeID()
 {
     return(ProductTypeRepo.getLastProductTypeID());
 }
コード例 #11
0
 public ProductTypeController(ProductTypeRepo repository)
 {
     _repository = repository;
 }
コード例 #12
0
 public static void remove(int ID)
 {
     ProductTypeRepo.remove(ProductTypeRepo.get(ID));
 }
コード例 #13
0
ファイル: UnitOfWork.cs プロジェクト: samkale-house/GMart
 public UnitOfWork(GMartDbContext gMartDbContext)//gmartdbcontext added for DI by gmartui startup configureservices
 {
     _gMartDbContext   = gMartDbContext;
     productRepository = new ProductRepository(_gMartDbContext);
     productTypeRepo   = new ProductTypeRepo(_gMartDbContext);
 }
コード例 #14
0
        public static string getProductType(int ID)
        {
            ProductType pt = ProductTypeRepo.getProductType(ID);

            return(pt.Name);
        }
コード例 #15
0
 public static List <ProductType> getAllProductType()
 {
     return(ProductTypeRepo.GetProductType());
 }
コード例 #16
0
 public static void doUpdateProductType(int id, string productTypeName, string description)
 {
     ProductTypeRepo.Update(id, productTypeName, description);
 }
コード例 #17
0
 public static ProductType getProductTypeByName(string name)
 {
     return(ProductTypeRepo.getProductTypeByName(name));
 }
コード例 #18
0
 public static ProductType getProductTypeById(int id)
 {
     return(ProductTypeRepo.GetProductTypeByID(id));
 }
コード例 #19
0
 public static void insertProductType(String Name, String Description)
 {
     ProductTypeRepo.insertProductType(ProductTypeFactory.createProductType(Name, Description));
 }
コード例 #20
0
 public static void doCreateProductType(string productTypeName, string description)
 {
     ProductTypeRepo.Create(productTypeName, description);
 }
コード例 #21
0
 public static ProductType get(int ID)
 {
     return(ProductTypeRepo.get(ID));
 }
コード例 #22
0
 public static void doDeleteProductType(int id)
 {
     ProductTypeRepo.Delete(id);
 }
コード例 #23
0
 public static void updateProductType(int ID, String Name, String Description)
 {
     ProductTypeRepo.updateProductType(ID, Name, Description);
 }