예제 #1
0
        public void Bind4()
        {
            string sql = "select top 5 *  from [Plan] where username='******' order by planid desc";

            this.DataList4.DataSource = OperateDB.ExecuteDataSet(sql);
            this.DataList4.DataBind();
        }
예제 #2
0
        public void Bind3()
        {
            string sql = "select top 5 * from News order by NewsID desc";

            DataList3.DataSource = OperateDB.ExecuteDataSet(sql);
            DataList3.DataBind();
        }
예제 #3
0
        public string getname()
        {
            string sql = "select Name from Employee where username='******'";

            string Name = OperateDB.getExecuteScalar(sql);

            return(Name);
        }
예제 #4
0
        private void bind2()
        {
            string Name = SelectName();
            string sql  = "select top 5 title,sid,Pubdate from Email where Meetname='" + Name + "' order by sid desc ";

            this.DataList2.DataSource = OperateDB.ExecuteDataSet(sql);
            this.DataList2.DataBind();
        }
예제 #5
0
        private static string getemailnum(string Name)
        {
            string sql1 = string.Format(@"SELECT  COUNT(*) AS Expr1
FROM      Email
WHERE   (Meetname = '{0}') AND (Status = '未读')", Name);
            string s    = OperateDB.getExecuteScalar(sql1);

            return(s);
        }
예제 #6
0
        private void bing1()
        {
            string  UserName = Session["UserName"].ToString();
            string  sql      = "select id from UserInfo where UserName='******'";
            int     id       = Convert.ToInt32(OperateDB.getExecuteScalar(sql));
            string  sql1     = "select top 5 * from Calendar where id=" + id + " order by CalendarID desc";
            DataSet ds       = OperateDB.ExecuteDataSet(sql1);

            this.DataList1.DataSource = ds.Tables[0];
            this.DataList1.DataBind();
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string num = getemailnum(getname());

            if (num != "0")
            {
                this.emailcount.InnerText = num;
                this.title.InnerHtml      = "You have " + num + " Mails";
                string sql = "select * from Email where Meetname='" + getname() + "' and Status = '未读'";
                this.dl.DataSource = OperateDB.ExecuteDataSet(sql);
                dl.DataBind();
            }
        }
예제 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!OA.Administrator.admin.isadmin(Session["UserName"].ToString()))
     {
         Response.Write("<script>alert('你没有权限');window.opener=null;window.close();</script>");
     }
     else
     {
         string num = getemailnum(getname());
         if (num != "0")
         {
             this.emailcount.InnerText = num;
             this.title.InnerHtml      = "You have " + num + " Mails";
             string sql = "select * from Email where Meetname='" + getname() + "' and Status = '未读'";
             this.dl.DataSource = OperateDB.ExecuteDataSet(sql);
             dl.DataBind();
         }
     }
 }
예제 #9
0
        public static PagedDataSource paged(string sql, AspNetPager AspNetPager1)
        {
            DataSet   ds = OperateDB.ExecuteDataSet(sql);
            DataTable dt = new DataTable();

            dt = ds.Tables[0];
            DataColumn dc = dt.Columns.Add("number", System.Type.GetType("System.String"));

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["number"] = (i + 1).ToString();
            }
            DataView        dv  = ds.Tables[0].DefaultView;
            PagedDataSource pds = new PagedDataSource();

            AspNetPager1.RecordCount = dv.Count;
            pds.DataSource           = dv;
            pds.AllowPaging          = true;
            pds.CurrentPageIndex     = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize             = AspNetPager1.PageSize;
            return(pds);
        }
예제 #10
0
        public string getRemark()
        {
            string        html = "";
            string        sql1 = "select top 5 * from NewsRemark where NewID in (select newsid from News where UserID=(select Employeeid from Employee where username='******')) order by Pubdate desc";
            SqlConnection con1 = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);

            con1.Open();
            SqlCommand    com1       = new SqlCommand(sql1, con1);
            SqlDataReader dr1        = com1.ExecuteReader();
            List <remark> remarklist = new List <remark>();

            while (dr1.Read())
            {
                remark re  = new remark();
                string sql = "select username from Employee where Employeeid=" + dr1["UserID"];
                re.username = OperateDB.getExecuteScalar(sql);
                sql         = "select title from News where NewsID=" + dr1["NewID"];
                re.title    = OperateDB.getExecuteScalar(sql);
                re.content  = dr1["content"].ToString();
                re.time     = dr1["Pubdate"].ToString();
                remarklist.Add(re);
            }
            foreach (var item in remarklist)
            {
                html += string.Format(@"<li class='in'>
                                    <img src='images/anonymous.png' alt='' class='avatar'>
                                    <div class='message'>
                                        <span class='arrow'></span>
                                        <a class='name' href='#'>{0}</a>
                                        <span class='datetime'>at {1}</span>
                                        <span class='body'>
                                            {2}
                                        </span>
                                    </div>
                                </li>", item.username, item.time, item.content);
            }
            return(html);
        }
예제 #11
0
파일: log.cs 프로젝트: zhuxuda/biyesheji
        public void InsertWorkLog(string UserName, string WorkTime, string WorkInfo)
        {
            string sql = "insert into WorkLog values('" + UserName + "','" + WorkTime + "','" + WorkInfo + "')";

            OperateDB.ExecuteNonQuery(sql);
        }