private void Bind() { string pageNav = ""; string sql = @"select flowID, billCode,isnull((select '['+usercode+']'+userName from bill_users where usercode=bill_main.billUser),billUser) as billuser,(select zynr from bill_lscg where cgbh=bill_main.billCode) as zynr,isnull((select '['+deptCode+']'+deptName from bill_departments where deptcode=bill_main.billDept),billDept) as billDept,bill_main.billDept as deptCode,(select '['+usercode+']'+username from bill_users where usercode=billuser) as billUserName,convert(varchar(10),billDate,121) as billDate,billje ,Row_Number()over(order by billCode desc,billdate desc) as crow from bill_main where (billUser='******' or billCode in (select cgbh from bill_lscg where cbr='" + Session["userCode"].ToString() + "')) and flowID='lscg'"; int year = System.DateTime.Now.Year; int month = System.DateTime.Now.Month; DateTime end = System.DateTime.Now; DateTime beg = Convert.ToDateTime(year + "-" + month + "-01"); if (ddlTime.SelectedValue == "2") { beg = beg.AddMonths(-1); end = beg; } else if (ddlTime.SelectedValue == "3") { beg = beg.AddMonths(-2); } if (ddlTime.SelectedValue != "4") { sql += " and billDate >='" + beg.ToString("yyyy-MM-dd") + "' and billDate <='" + end.ToString("yyyy-MM-dd") + "'"; } //时间区间 string strDateType = ddlTime.SelectedValue.Trim(); string strURL = string.Format("bgsqList.aspx?tp={0}", strDateType); DataTable dt = PubMethod.GetPageData(sql, strURL, out pageNav); Repeater1.DataSource = dt; Repeater1.DataBind(); lbPageNav.InnerHtml = pageNav; }
private void Bind() { string pageNav = ""; string sql = @"select flowID, billCode,billName,isnull((select '['+usercode+']'+userName from bill_users where usercode=bill_main.billUser),billUser) as billuser,isnull((select '['+deptCode+']'+deptName from bill_departments where deptcode=bill_main.billDept),billDept) as billDept,bill_main.billDept as deptCode,(select '['+usercode+']'+username from bill_users where usercode=billuser) as billUserName,convert(varchar(10),billDate,121) as billDate,billje ,Row_Number()over(order by billCode desc,billdate desc) as crow, b.travelDate,b.arrdess,b.reasion,b.needAmount,b.travelplan from bill_main ,(select distinct arrdess,reasion,travelDate,needamount,travelplan,maincode from bill_travelApplication) b where billCode=mainCode and billUser='******' and flowID='ccsq'"; int year = System.DateTime.Now.Year; int month = System.DateTime.Now.Month; DateTime end = System.DateTime.Now; DateTime beg = Convert.ToDateTime(year + "-" + month + "-01"); if (ddlTime.SelectedValue == "2") { beg = beg.AddMonths(-1); end = beg; } else if (ddlTime.SelectedValue == "3") { beg = beg.AddMonths(-2); } if (ddlTime.SelectedValue != "4") { sql += " and billDate >='" + beg.ToString("yyyy-MM-dd") + "' and billDate <='" + end.ToString("yyyy-MM-dd") + "'"; } //时间区间 string strDateType = ddlTime.SelectedValue.Trim(); string strURL = string.Format("travelApplyList.aspx?tp={0}", strDateType); DataTable dt = PubMethod.GetPageData(sql, strURL, out pageNav); Repeater1.DataSource = dt; Repeater1.DataBind(); lbPageNav.InnerHtml = pageNav; }
private void BindData() { string pageNav = ""; string sql = "select id, title, contents, writer, convert(varchar(10),date,121) as date, readTimes, mstype, notifierid,notifiername,endtime,Accessories,Row_Number()over(order by date desc) crow from bill_msg where writer='" + Session["userCode"].ToString() + "'"; DataTable dt = PubMethod.GetPageData(sql, "messageList.aspx", out pageNav); Repeater1.DataSource = dt; Repeater1.DataBind(); lbPageNav.InnerHtml = pageNav; }
private void BindData() { string pageNav = ""; string sql = GetSql(); DataTable dt = PubMethod.GetPageData(sql, "travelApplyAudit.aspx", out pageNav); Repeater1.DataSource = dt; Repeater1.DataBind(); lbPageNav.InnerHtml = pageNav; }
private void BindData() { ltrTitle.Text = GetTitleByFlowid(Request["flowid"]); string pageNav = ""; string sql = GetSql(); DataTable dt = PubMethod.GetPageData(sql, "ybbxAuditList.aspx", out pageNav); Repeater1.DataSource = dt; Repeater1.DataBind(); lbPageNav.InnerHtml = pageNav; }
private void BindData() { string pageNav = ""; string dtime = DateTime.Now.ToString("yyyy-MM-dd"); string userCode = Convert.ToString(Session["userCode"]); string username = Convert.ToString(Session["userName"]); string sql = "select Row_Number()over(order by date desc) as crow ,id,title,(select username from bill_users where usercode = writer) as writer,contents,CONVERT(varchar(100),date, 23) as date ,isnull(readtimes,0) as readtimes,mstype,endtime from bill_msg where endtime>='" + dtime + "' and (notifiername like'%" + userCode + "%' or notifiername like'%" + username + "%') and mstype='通知' or (mstype='新闻' and endtime>='" + dtime + "' )"; DataTable dt = PubMethod.GetPageData(sql, "messageGetList.aspx", out pageNav); Repeater1.DataSource = dt; Repeater1.DataBind(); lbPageNav.InnerHtml = pageNav; }
private void Bind() { string pageNav = ""; string djlx = "ybbx"; string strisdz = ""; if (!string.IsNullOrEmpty(Request["isdz"])) { strisdz = Request["isdz"].ToString(); } if (strisdz == "1") { djlx = "yksq_dz"; } if (!string.IsNullOrEmpty(Request["dydj"])) { djlx = Convert.ToString(Request["dydj"]); } string sql = @"select Row_Number()over(order by billdate desc,billName desc) as crow ,sum(je) as billJe,billname,flowid,stepid,billuser,billdate,isgk,(select bxzy from bill_ybbxmxb where bill_ybbxmxb.billCode=(select top 1 billcode from bill_main where billname=main.billName)) as bxzy, (select xmmc from bill_ysgc where gcbh=billName) as billName2,(select top 1 billdept from bill_main where billname=main.billname) as billdept, (select '['+usercode+']'+username from bill_users where usercode=billuser) as billUserName from bill_main main inner join bill_ybbxmxb_fykm fykm on main.billcode=fykm.billcode where flowid='" + djlx + "' and (billUser='******' or main.billcode in (select billCode from bill_ybbxmxb where bxr='" + Session["userCode"].ToString().Trim() + "') )";//or billDept in (" + deptCodes + ") // string sql = @"select flowID, billName,isnull((select '['+usercode+']'+userName from bill_users where usercode=bill_main.billUser),billUser) as billuser // ,isGk,gkDept,(select bxzy from bill_ybbxmxb where bill_ybbxmxb.billCode=bill_main.billCode) as bxzy,stepid,isnull((select '['+deptCode+']'+deptName // from bill_departments where deptcode=bill_main.billDept),billDept) as billDept,bill_main.billDept as deptCode,billCode,(select xmmc from bill_ysgc where gcbh=billName) // as billName2,(select '['+usercode+']'+username from bill_users where usercode=billuser) as billUserName,convert(varchar(10),billDate,121) as billDate,billje // ,Row_Number()over(order by billName desc,billdate desc) as crow from bill_main // where (billUser='******' or billCode in (select billCode from bill_ybbxmxb where bxr='" + Session["userCode"].ToString().Trim() + "')) and flowID='" + djlx + "'"; int year = System.DateTime.Now.Year; int month = System.DateTime.Now.Month; DateTime end = System.DateTime.Now; DateTime beg = Convert.ToDateTime(year + "-" + month + "-01"); if (ddlTime.SelectedValue == "2") { beg = beg.AddMonths(-1); end = beg; } else if (ddlTime.SelectedValue == "3") { beg = beg.AddMonths(-2); } if (ddlTime.SelectedValue != "4") { sql += " and convert(varchar(10),billDate,121) >='" + beg.ToString("yyyy-MM-dd") + "' and convert(varchar(10),billDate,121) <='" + end.ToString("yyyy-MM-dd") + "'"; } //时间区间 string strDateType = ddlTime.SelectedValue.Trim(); string strURL = string.Format("ybbxList.aspx?tp={0}", strDateType); //求和 sql += " group by billname,flowid,stepid,billuser,billdate,isgk "; DataTable dt = PubMethod.GetPageData(sql, strURL, out pageNav); Repeater1.DataSource = dt; Repeater1.DataBind(); lbPageNav.InnerHtml = pageNav; }