Пример #1
0
        protected void cmdUpdateorder_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (grdView.Rows.Count == 0) return;

                CNews BLL = new CNews(CCommon.LANG);
                foreach (GridViewRow row in grdView.Rows)
                {
                    HiddenField txtId = (HiddenField)row.FindControl("txtId");
                    TextBox txtOrderd = (TextBox)row.FindControl("txtOrderd");
                    if (txtId != null && txtOrderd != null)
                    {
                        int id = int.Parse(txtId.Value);
                        int orderd = 0;
                        int.TryParse(txtOrderd.Text, out orderd);
                        BLL.Updatenum(id.ToString(), Queryparam.Sqlcolumn.Orderd, orderd);
                    }
                    lstError = new List<Errorobject>();
                    lstError = Form_GetError(lstError, Errortype.Completed, Definephrase.Saveorderd_completed, "", null);
                    Master.Form_ShowError(lstError);
                }
            }
            catch
            {
                lstError = new List<Errorobject>();
                lstError = Form_GetError(lstError, Errortype.Error, Definephrase.Saveorderd_error, "", null);
                Master.Form_ShowError(lstError);
            }
        }
Пример #2
0
        private void Load_Info(int iid)
        {
            CNews DAL = new CNews(CCommon.LANG);
            NewsInfo info = DAL.Getinfo(iid);
            if (info != null)
            {
                if (info.Allowcomment > 0)
                {
                    CommentInfo comment = new CComment(CCommon.LANG).Getinforating(Webcmm.Id.News, info.Id);
                    if (comment != null)
                    {
                        if ((comment.Viewcounter + 1) != info.Allowcomment)
                        {
                            info.Allowcomment = comment.Viewcounter + 1;
                            DAL.Updatenum(info.Id.ToString(), Queryparam.Sqlcolumn.Allowcomment, info.Allowcomment);
                        }
                        info.Rating = comment.Rating / (comment.Viewcounter == 0 ? 1 : comment.Viewcounter);
                    }
                }
                List<NewsInfo> list = new List<NewsInfo>();
                list.Add(info);
                (new GenericList<NewsInfo>()).Bind_DataList(rptInfo, null, list, 0);
                DAL.Updatenum(iid.ToString(), Queryparam.Sqlcolumn.Viewcounter, CConstants.NUM_INCREASE);

                Master.AddMeta_Title(info.Name);
                Master.AddMeta_Description(info.Introduce);
                Master.AddMeta_Keywords(info.Tag);
            }

            pnlListfollow.Visible = pnlInfo.Visible = info != null;
        }
Пример #3
0
        private void Load_Info(int iid)
        {
            CNews DAL = new CNews(CCommon.LANG);
            NewsInfo info = DAL.Getinfo(iid);
            if (info != null)
            {
                if (info.Allowcomment > 0)
                {
                    CommentInfo comment = new CComment(CCommon.LANG).Getinforating(Webcmm.Id.News, info.Id);
                    if (comment != null)
                    {
                        if ((comment.Viewcounter + 1) != info.Allowcomment)
                        {
                            info.Allowcomment = comment.Viewcounter + 1;
                            DAL.Updatenum(info.Id.ToString(), Queryparam.Sqlcolumn.Allowcomment, info.Allowcomment);
                        }
                        info.Rating = comment.Rating / (comment.Viewcounter == 0 ? 1 : comment.Viewcounter);
                    }
                }
                List<NewsInfo> list = new List<NewsInfo>();
                list.Add(info);
                list = list.OrderBy(m => m.Name).ToList();
                (new GenericList<NewsInfo>()).Bind_DataList(rptInfo, null, list, 0);
                DAL.Updatenum(iid.ToString(), Queryparam.Sqlcolumn.Viewcounter, CConstants.NUM_INCREASE);
                breadcrums += tach;
                string linkCat = "<a href=\"/tu-dien-thuat-ngu-" + Langview + "/" + info.eUrl2 + "\">" + info.Name + "</a>";
                breadcrums += linkCat;
                Master.AddMeta_Title(info.Name);
                Master.AddMeta_Description(info.Introduce);
                Master.AddMeta_Keywords(info.Tag);
            }

            pnlListfollow.Visible = pnlInfo.Visible = info != null;
        }