Пример #1
0
 public void ViewBrand()
 {
     BrandBSO brandBSO = new BrandBSO();
     DataTable table = brandBSO.GetBrandAll(Language.language);
     commonBSO commonBSO = new commonBSO();
     commonBSO.FillToGridView(grvBrand, table);
 }
Пример #2
0
 private void initControl(int Id)
 {
     if (Id > 0)
     {
         btn_add.Visible = false;
         btn_edit.Visible = true;
         try
         {
             BrandBSO brandBSO = new BrandBSO();
             Brand brand = brandBSO.GetBrandById(Id);
             hddBrandID.Value = Convert.ToString(brand.BrandID);
             hddIcon.Value = brand.Image;
             uploadPreview.Src = ResolveUrl("~/Upload/Brand/") + brand.Image;
             txtBrandName.Text = brand.BrandName;
             txtBrandUrl.Text = brand.BrandUrl;
             txtShortDescribe.Text = brand.ShortDescribe;
         }
         catch (Exception ex)
         {
             clientview.Text = ex.Message.ToString();
         }
     }
     else
     {
         btn_add.Visible = true;
         btn_edit.Visible = false;
     }
 }
Пример #3
0
 private void ViewBrand(string lang)
 {
     BrandBSO brandBSO = new BrandBSO();
     DataTable table = brandBSO.GetBrandAll(lang);
     Repeater1.DataSource = table;
     Repeater1.DataBind();
 }
Пример #4
0
 private void ViewBrand(string lang)
 {
     BrandBSO brandBSO = new BrandBSO();
     DataTable table = brandBSO.GetBrandAll(lang);
     DropDownList1.DataSource = table;
     DropDownList1.DataTextField = "BrandName";
     DropDownList1.DataValueField = "BrandUrl";
     DropDownList1.DataBind();
 }
Пример #5
0
        protected void grvBrand_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Id = Convert.ToInt32(e.CommandArgument.ToString());
            string nName = e.CommandName.ToLower();
            switch (nName)
            {

                case "_edit":
                    Response.Redirect("~/Admin/editbrand/" + Id + "/Default.aspx");
                    break;
                case "_delete":

                    BrandBSO brandBSO = new BrandBSO();
                    brandBSO.DeleteBrand(Id);
                    ViewBrand();
                    break;
            }
        }
Пример #6
0
 protected void btn_add_Click(object sender, EventArgs e)
 {
     try
     {
         Brand brand = ReceiveHtml();
         BrandBSO brandBSO = new BrandBSO();
         brandBSO.CreateBrand(brand);
         clientview.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful);
     }
     catch (Exception ex)
     {
         clientview.Text = ex.Message.ToString();
     }
 }
Пример #7
0
 protected void btn_edit_Click(object sender, EventArgs e)
 {
     try
     {
         Brand brand = ReceiveHtml();
         BrandBSO brandBSO = new BrandBSO();
         brandBSO.UpdateBrand(brand);
         clientview.Text = String.Format(Resources.StringAdmin.UpdateSuccessful, "hãng", brand.BrandName);
     }
     catch (Exception ex)
     {
         clientview.Text = ex.Message.ToString();
     }
 }