private void ViewCateGroup()
 {
     ddlAlbumsCate.Items.Clear();
     AlbumsCateBSO albumscateBSO = new AlbumsCateBSO();
     DataTable table = albumscateBSO.GetAlbumsCate();
     commonBSO commonBSO = new commonBSO();
     commonBSO.FillToDropDown(ddlAlbumsCate, table, "~~ Danh mục gốc ~~", "0", "AlbumsCateName", "AlbumsCateID", "");
 }
Esempio n. 2
0
        private void GetAlbumsCate()
        {
            AlbumsCateBSO albumscateBSO = new AlbumsCateBSO();
            DataTable table = albumscateBSO.GetAlbumsCate();

            Repeater1.DataSource = table;
            Repeater1.DataBind();
        }
        private void ViewAlbumsCate()
        {
            AlbumsCateBSO albumcateBSO = new AlbumsCateBSO();
            DataTable table = albumcateBSO.GetAlbumsCate();
            commonBSO commonBSO = new commonBSO();
            commonBSO.FillToGridView(grvAlbumsCate, table);

        }
Esempio n. 4
0
        private void BindAlbumsCate(int cId)
        {
            AlbumsCateBSO albumscateBSO = new AlbumsCateBSO();
            DataTable table = albumscateBSO.GetAlbumsCate();
            commonBSO commonBSO = new commonBSO();
            commonBSO.FillToDropDown(ddlAlbumsCate, table, "", "", "AlbumsCateName", "AlbumsCateID", "");

            if (cId != 0)
            {
                ddlAlbumsCate.Enabled = false;
                ddlAlbumsCate.SelectedValue = Convert.ToString(cId);

            }
            else
                ddlAlbumsCate.Enabled = true;
        }
        private void initControl(int Id)
        {
            if (Id > 0)
            {
                btn_add.Visible = false;
                btn_edit.Visible = true;
                try
                {
                    AlbumsCateBSO albumscateBSO = new AlbumsCateBSO();
                    AlbumsCate albumscate = albumscateBSO.GetAlbumsCateById(Id);

                    hddAlbumsCateID.Value = Convert.ToString(albumscate.AlbumsCateID);
                    hddParentID.Value = Convert.ToString(albumscate.ParentCateID);
                    ddlAlbumsCate.SelectedValue = Convert.ToString(albumscate.ParentCateID);

                    ddlAlbumsCate.Items.Remove(new ListItem(albumscate.AlbumsCateName, Convert.ToString(albumscate.AlbumsCateID)));

                    txtAlbumsCateName.Text = albumscate.AlbumsCateName;
                    hddAlbumsCateOrder.Value = Convert.ToString(albumscate.AlbumsCateOrder);
                    hddAlbumsCateTotal.Value = Convert.ToString(albumscate.AlbumsCateTotal);
                    hddImageThumb.Value = albumscate.ImageThumb;
                    hddImageLarge.Value = albumscate.ImageLarge;
                    txtSlogan.Text = albumscate.Description;
                    hddUserName.Value = Session["Admin_UserName"].ToString();
                    hddCreated.Value = DateTime.Now.ToString();



                    //  ViewCateGroup();
                }
                catch (Exception ex)
                {
                    clientview.Text = ex.Message.ToString();
                }
            }
            else
            {
                btn_edit.Visible = false;
                btn_add.Visible = true;

            }
        }
        protected void grvAlbumsCate_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int Id = Convert.ToInt32(e.CommandArgument.ToString());
            string nName = e.CommandName.ToLower();
            switch (nName)
            {
                case "_viewimage":
                    Response.Redirect("~/Admin/listalbums/" + Id + "/Default.aspx");
                    break;

                case "_addimage":
                    Response.Redirect("~/Admin/Group/editalbums/" + Id + "/Default.aspx");
                    break;

                case "_edit":
                    Response.Redirect("~/Admin/editalbumscate/" + Id + "/Default.aspx");
                    break;
                case "_delete":
                    AlbumsCateBSO albumcateBSO = new AlbumsCateBSO();
                    albumcateBSO.DeleteAlbumsCateAll(Id);
                    ViewAlbumsCate();
                    break;
            }
        }
        protected void btn_edit_Click(object sender, EventArgs e)
        {
            try
            {
                AlbumsCate albumscate = ReceiveHtml();

                AlbumsCateBSO albumscateBSO = new AlbumsCateBSO();

                albumscateBSO.UpdateAlbumsCate(albumscate);

                clientview.Text = String.Format(Resources.StringAdmin.UpdateSuccessful, "danh mục", albumscate.AlbumsCateName);

                ViewCateGroup();

            }
            catch (Exception ex)
            {
                clientview.Text = ex.Message.ToString();
            }
        }
        protected void btn_add_Click(object sender, EventArgs e)
        {
            try
            {
                AlbumsCate albumscate = ReceiveHtml();
                AlbumsCateBSO albumscateBSO = new AlbumsCateBSO();

                albumscateBSO.CreateCateNew(albumscate);
                clientview.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful);

                ViewCateGroup();
                //}

            }
            catch (Exception ex)
            {
                clientview.Text = ex.Message.ToString();
            }
        }
 protected void btn_Order_Click(object sender, ImageClickEventArgs e)
 {
     foreach (GridViewRow row in grvAlbumsCate.Rows)
     {
         TextBox textOrder = (TextBox)row.FindControl("txtAlbumsCateOrder");
         int cOrder = Convert.ToInt32(textOrder.Text);
         int cateID = Convert.ToInt32(row.Cells[0].Text);
         AlbumsCateBSO albumcateBSO = new AlbumsCateBSO();
         albumcateBSO.AlbumsCateUpOrder(cateID, cOrder);
     }
     ViewAlbumsCate();
 }