Exemplo n.º 1
0
    protected void BrandBind()
    {
        List <WMGoodBrands> list = WMGoodBrands.GetList();

        BrandList.DataSource = list;
        BrandList.DataBind();
    }
Exemplo n.º 2
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        bool   flag = false;
        string msg  = string.Empty;

        if (this.IsValid)
        {
            WMGoodBrands brand = !General.IsNullable(Id) ? WMGoodBrands.Get(Id) : new WMGoodBrands();
            brand.Name = BrandName.Text;
            brand.URL  = BrandUrl.Text;

            if (ImageUpload.HasFile)
            {
                string fileName = string.Format("/share/upload/good/brand/{0}.jpg", DateTime.Now.ToFileTime());
                Jumpcity.IO.FileUpload upload = new Jumpcity.IO.FileUpload("~" + fileName, 0, 0);
                if (upload.Upload(ImageUpload.PostedFile.InputStream))
                {
                    brand.Logo         = fileName;
                    BrandLogo.ImageUrl = upload.FileName;
                }
            }

            if (!General.IsNullable(brand.Id))
            {
                flag = brand.Update();
            }
            else
            {
                flag = brand.Add();
            }
        }

        Helper.MessageBox(flag);
    }
Exemplo n.º 3
0
    protected void Bind()
    {
        int pageCount            = 0;
        List <WMGoodBrands> list = WMGoodBrands.GetList(out pageCount, Name, Pager.CurrentPageIndex - 1, Pager.PageSize);

        ListConatner.DataSource = list;
        ListConatner.DataBind();
        Pager.RecordCount = pageCount;
    }
Exemplo n.º 4
0
    protected void Bind()
    {
        WMGoodBrands model = WMGoodBrands.Get(Id);

        if (model != null)
        {
            BrandName.Text     = model.Name;
            BrandUrl.Text      = model.URL;
            BrandLogo.ImageUrl = model.Logo;
        }
    }
Exemplo n.º 5
0
    protected void ListConatner_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            string id   = e.CommandArgument.ToString();
            bool   flag = WMGoodBrands.Delete(id);

            if (flag)
            {
                Bind();
            }

            Helper.MessageBox(flag);
        }
    }
Exemplo n.º 6
0
    protected void BrandBind()
    {
        List <WMGoodBrands> list = WMGoodBrands.GetList();

        if (!General.IsNullable(list))
        {
            BrandList.Items.Clear();
            foreach (var b in list)
            {
                ListItem item = new ListItem();
                item.Text  = b.Name;
                item.Value = b.Id;
                BrandList.Items.Add(item);
            }
        }
    }