Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    DataTable dtConfig = ConfigService.Config_GetByTop("1", "", "");
                    if (dtConfig.Rows.Count > 0)
                    {
                        Page.Title           = dtConfig.Rows[0]["Title"].ToString();
                        Page.MetaDescription = dtConfig.Rows[0]["Description"].ToString();
                        Page.MetaKeywords    = dtConfig.Rows[0]["Keyword"].ToString();
                    }

                    //Giới thiệu về chúng tôi
                    DataTable dt = PageService.Page_GetByTop("1", "Name like N'%giới thiệu%'", "");
                    if (dt.Rows.Count > 0)
                    {
                        sAboutName = dt.Rows[0]["Name"].ToString();
                        sContents  = dt.Rows[0]["Description"].ToString();
                        sUrl       = dt.Rows[0]["Link"].ToString();
                    }
                    dt.Clear();
                    HttpCookie cookie = Request.Cookies[Consts.GUID_SHOPPING_CART];

                    DataTable dtGroup = GroupProductService.GroupProduct_GetByTop("", "Active=1 And Position=1", "Level, Ord");
                    DataTable dtTop   = dtGroup.AsEnumerable().Take(2).CopyToDataTable();

                    for (int i = 0; i < dtGroup.Rows.Count; i++)
                    {
                        if (i < 2)
                        {
                            dtGroup.Rows[i].Delete();
                        }
                    }
                    dtGroup.AcceptChanges();
                    rptGroup.DataSource = StringClass.ModifyDataGroupProduct(dtTop);
                    rptGroup.DataBind();
                    rptGroup01.DataSource = StringClass.ModifyDataGroupProduct(dtGroup);
                    rptGroup01.DataBind();
                }
            }
            catch (Exception ex)
            {
                MailSender.SendMail("", "", "Error System", ex.Message + "\n" + ex.StackTrace);
            }
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             if (dtGroup != null && dtGroup.Rows.Count > 0)
             {
                 rptGroup.DataSource = StringClass.ModifyDataGroupProduct(dtGroup);
                 rptGroup.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         MailSender.SendMail("", "", "Error System", ex.Message + "\n" + ex.StackTrace);
     }
 }