示例#1
0
        public void grdListCategory_EditCommand(object source, DataGridCommandEventArgs e)
        {
            HPCBusinessLogic.DAL.T_Customer_AdsDAL obj_Cate = new HPCBusinessLogic.DAL.T_Customer_AdsDAL();
            if (e.CommandArgument.ToString().ToLower() == "edit")
            {
                int catID = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
                Session["AsdLogolist_LangID"] = cbo_lanquage.SelectedValue;
                Response.Redirect("~/Quangcao/AdsLogoEdit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
            }
            if (e.CommandArgument.ToString().ToLower() == "viewads")
            {
                T_Customer_Ads    _obj   = new T_Customer_Ads();
                T_Customer_AdsDAL _DAL   = new T_Customer_AdsDAL();
                DataTable         _dtAds = null;
                try
                {
                    EID  = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
                    _obj = _DAL.GetOneFromT_Customer_AdsByID(EID);
                    if (_obj.Possittion.ToString() != "")
                    {
                        _dtAds = _DAL.BindGridT_Customer_Ads(_obj.Possittion.ToString().Trim()).Tables[0];

                        rptSlideShows.DataSource = _dtAds.DefaultView;
                        rptSlideShows.DataBind();
                    }

                    ModalPopupExtender2.Show();
                }
                catch (Exception ex)
                { }
            }
        }
        public int GetTotalsAds()
        {
            int strTemp = 0;

            if (EID != -1)
            {
                T_Customer_Ads    _obj = new T_Customer_Ads();
                T_Customer_AdsDAL _DAL = new T_Customer_AdsDAL();
                _obj = _DAL.GetOneFromT_Customer_AdsByID(EID);
                if (_obj.Possittion.ToString() != "")
                {
                    strTemp = Convert.ToInt32(_DAL.BindGridT_Customer_Ads(_obj.Possittion.ToString().Trim()).Tables[0].Rows.Count.ToString());
                }
            }
            return(strTemp);
        }