示例#1
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 = "";
     }
 }
        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)", ""));
        }
        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
            {

            }
        }