Exemplo n.º 1
0
        /// <summary>
        /// 分页显示
        /// </summary>
        /// <param name="pageindex">页码</param>
        /// <param name="keys">搜索条件</param>
        protected void ShowKcList(int pageindex, string KeySel)//分页显示符合条件的内容
        {
            DataTable DT        = new DataTable();
            string    sqlWhere1 = "";

            sqlWhere1 = sqlWhere(KeySel);
            string allTiaoshu = dtrowsHidden.Value.ToString();//获取到所有的条数

            if (allTiaoshu == "" || allTiaoshu == null)
            {
                allTiaoshu = "0";
            }
            int alltiaoshuInt = int.Parse(allTiaoshu);

            DT        = PageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "GUESTBOOK_MAIN", "DATETIME").Tables[0]; //用带有分页功能的列表进行显示
            pageindex = PageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);                                                               //获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
            if (DT.Rows.Count > 0)
            {
                //当获取到的数据集不为空的时候,显示在GridView1中
                GridView1.Visible     = true;
                GridView1.DataSource  = DT;                                                                                                                                                     //指定GridView1的数据是DT
                pageindexHidden.Value = pageindex.ToString();                                                                                                                                   //给隐藏的页码变量赋值,给下面的分页控件提供数据
                GridView1.DataBind();                                                                                                                                                           //将上面指定的信息绑定到GridView1上

                PageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                notice.Text             = "";
                pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
            }
            else
            {
                GridView1.Visible       = false;
                notice.Text             = "*没有符合条件的结果!";
                pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="groupname"></param>
        protected void BindData1(int pageindex)//信息发送箱
        {
            try
            {
                //string strSQL = "SELECT * FROM vNews_News WHERE " + SQLCondition();
                DataTable dt            = new DataTable();
                string    allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int       alltiaoshuInt = int.Parse(allTiaoshu);
                dt        = pageControl.GetList_FenYe_Common(SQLCondition1(), pageindex, GridView1.PageSize, alltiaoshuInt, "vNews_News1", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (dt.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中
                    Button_delete.Enabled = true;
                    GridView1.Visible     = true;
                    GridView1.DataSource  = dt; //指定GridView1的数据是dv
                    GridView1.DataBind();       //将上面指定的信息绑定到GridView1上
                    notice.Text = "";


                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件

                    GridView2.Visible = false;
                }
                else
                {
                    GridView1.Visible     = false;
                    Button_delete.Enabled = false;
                    notice.Text           = "*没有符合条件的结果!";

                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    if (alltiaoshuInt > 0)
                    {
                        BindData(pageindex - 1);
                    }

                    GridView2.Visible = false;
                }
            }
            catch
            {
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取业务申请列表信息
        /// </summary>
        protected void ShowApplyList(int pageindex, string type, string status)
        {
            try
            {
                DataTable        DT         = new DataTable();
                Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];
                //string sqlWhere1 = " DELFLAG=0 and ProjectID=" + Session["Work_ProjectId"] + " and Status = " + status + " and SendUserID = '" + user_model.ID + "'  and AppType = '" + type + "'";

                // string sqlWhere1 = " DELFLAG=0 and ProjectID=" + DDL_project.SelectedValue.ToString() + " and Status = " + status + " and SendUserID = '" + user_model.ID + "'  and AppType = '" + type + "'";
                string sqlWhere1 = "";
                if (status == "")
                {
                    sqlWhere1 = " DELFLAG=0 and SendUserID = '" + user_model.ID + "'  and AppType = '" + type + "'";
                }
                else
                {
                    sqlWhere1 = " DELFLAG=0 and Status = " + status + " and SendUserID = '" + user_model.ID + "'  and AppType = '" + type + "'";
                }

                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "vProject_Apply", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中

                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                                                                                                                                                     //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString();                                                                                                                                   //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                                                                                                                                                           //将上面指定的信息绑定到GridView1上

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text             = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    Button_revoke.Enabled   = false;
                    if (alltiaoshuInt > 0)
                    {
                        ShowApplyList(pageindex - 1, type, status);
                    }
                }
            }
            catch
            {
                GridView1.Visible       = false;
                notice.Text             = "*进入业务申请列表发生错误!";
                pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                Button_revoke.Enabled   = false;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///显示待审核的项目列表信息
        /// </summary>
        /// <param name="pageindex"></param>
        protected void ShowListInfo(int pageindex, string status)
        {
            try
            {
                DataTable        DT         = new DataTable();
                Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];

                string sqlWhere1 = " (BudgetList <> '') AND (BudgetList IS NOT NULL) AND (DELFLAG = 0) AND (Status = 1) ";

                string role = Request["role"].ToString();

                //如果是领导进入的预算管理,那么他只能看属于自己审批的项目的预算情况,如果是秘书或是财务的话,那么他们则能看到所有审批通过的预算管理情况。
                if (role.Equals("manager"))
                {
                    sqlWhere1 = sqlWhere1 + " AND (DoUserID = '" + user_model.ID + "') ";
                }

                sqlWhere1 = sqlWhere1 + " AND (TEMP1 = '" + status + "') ";

                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "vProject_Budget", "DATETIME").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中
                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                   //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString(); //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                         //将上面指定的信息绑定到GridView1上
                    Button_check.Enabled = true;
                    //Button_checkfalse.Enabled = true;
                    tag.Text = "";
                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text             = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    Button_check.Enabled    = false;
                    //Button_checkfalse.Enabled = false;
                    if (alltiaoshuInt > 0)
                    {
                        ShowListInfo(pageindex - 1, status);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 根据条件查询人员信息列表
        /// </summary>
        /// <param name="pageindex">页码</param>
        /// <param name="depart">部门</param>
        /// <param name="workstatus">工作状态</param>
        protected void ShowUsersList(int pageindex, string depart, string workstatus)
        {
            try
            {
                DataTable DT        = new DataTable();
                string    sqlWhere1 = "1=1";

                if (null != depart && depart != "")
                {
                    sqlWhere1 = sqlWhere1 + " and DepartMentID like '%" + depart + "%'  AND (DELFLAG = 0) ";
                }
                if (null != workstatus && workstatus != "")
                {
                    sqlWhere1 = sqlWhere1 + " and WorkStats = '" + workstatus + "' AND (DELFLAG = 0) ";
                }


                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "vUSER_Users", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中

                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                                                                                                                                                     //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString();                                                                                                                                   //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                                                                                                                                                           //将上面指定的信息绑定到GridView1上

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text             = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!请选择筛选条件!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    Button_modify.Enabled   = false;
                    Button_delete.Enabled   = false;
                    if (alltiaoshuInt > 0)
                    {
                        ShowUsersList(pageindex - 1, depart, workstatus);
                    }
                }
            }
            catch
            {
            }
        }
        protected void BindData(int pageIndex = 1)
        {
            try
            {
                string allTiaoshu    = dtrowsHidden.Value.ToString();             //获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                string swhere        = " 1=1 ";

                if (!string.IsNullOrEmpty(txtJF.Text))
                {
                    swhere += string.Format(" and BudgetName like '%{0}%'", txtJF.Text);
                }

                DataTable dt = new DataTable();
                dt        = pageControl.GetList_FenYe_Common(swhere, pageIndex, GridView2.PageSize, alltiaoshuInt, "vBudget_Department_Statistical", "ParentId").Tables[0];
                pageIndex = pageControl.pageindex(pageIndex, GridView2.PageSize, alltiaoshuInt);                //获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】

                if (dt.Rows.Count > 0)
                {
                    string rowNumberCol = "PX";
                    dt.Columns.Add(rowNumberCol, typeof(string));
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dt.Rows[i][rowNumberCol] = i + 1;
                    }

                    GridView2.Visible    = true;
                    GridView2.DataSource = dt;
                    GridView2.DataBind();
                    LB_MSG.Text = "";

                    common.GroupRows(GridView2, 10, 10);
                    common.GroupRows(GridView2, 10, 11);
                    common.GroupRows(GridView2, 10, 12);

                    pageControl.SetSelectPage(pageIndex, int.Parse(dtrowsHidden.Value.ToString()), DDL_ToPage, GridView2.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    pageControlShow.Visible = true;                                                                                                                                              //如果记录集不为空,则显示分页控件
                }
            }
            catch (Exception e)
            { }
        }
Exemplo n.º 7
0
        //绑定人员列表
        protected void BindData(int pageindex)
        {
            try
            {
                string sqlWhere1 = "(DELFLAG = '0') and status='1'and ProjectID='" + Session["Work_ProjectId"].ToString() + "'";

                DataTable DT = new DataTable();

                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "vProject_UserList", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中

                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                                                                                                                                                     //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString();                                                                                                                                   //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                                                                                                                                                           //将上面指定的信息绑定到GridView1上

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    LB_name.Text            = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    LB_name.Text            = "*没有符合条件的结果!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    if (alltiaoshuInt > 0)
                    {
                        BindData(pageindex - 1);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 8
0
        private void ShowKcList(int pageindex)
        {
            try
            {
                DataTable DT = new DataTable();
                UserModel = (Dianda.Model.USER_Users)Session["USER_Users"];
                string sqlWhere1  = " delflag='0' and UserID='" + UserModel.ID + "'";
                string allTiaoshu = dtrowsHidden.Value.ToString();//获取到所有的条数
                if (allTiaoshu == "" || allTiaoshu == null)
                {
                    allTiaoshu = "0";
                }
                int alltiaoshuInt = int.Parse(allTiaoshu);
                // DT =RoleBll.GetList_FenYe(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt).Tables[0];//用带有分页功能的列表进行显示
                DT        = PageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "Personal_Notepad", "DATETIME").Tables[0]; //用带有分页功能的列表进行显示
                pageindex = PageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);                                                                 //获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中
                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                                                                                                                                                     //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString();                                                                                                                                   //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                                                                                                                                                           //将上面指定的信息绑定到GridView1上

                    PageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text             = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                }
            }
            catch (Exception)
            {
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="groupname"></param>
        protected void BindData(int pageindex, string condition)
        {
            try
            {
                //1-全部、2-审批提醒、3-项目任务、4-共享文档、5-申请反馈、
                //6-通知公告、7-个人消息、8-项目消息、9-部门消息、10-历史消息
                //string strSQL = "SELECT * FROM vNews_News WHERE " + SQLCondition();
                DataTable dt            = new DataTable();
                string    allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int       alltiaoshuInt = int.Parse(allTiaoshu);
                dt        = pageControl.GetList_FenYe_Common(SQLCondition(condition), pageindex, GridView1.PageSize, alltiaoshuInt, "FaceShowMessage", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (dt.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中
                    GridView1.Visible    = true;
                    GridView1.DataSource = dt; //指定GridView1的数据是dv
                    GridView1.DataBind();      //将上面指定的信息绑定到GridView1上
                    notice.Text = "";

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    if (alltiaoshuInt > 0)
                    {
                        BindData(pageindex - 1, condition);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="groupname"></param>
        protected void BindData(int pageindex)
        {
            try
            {
                //string strSQL = "SELECT * FROM vNews_News WHERE " + SQLCondition();
                DataTable dt            = new DataTable();
                string    allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int       alltiaoshuInt = int.Parse(allTiaoshu);
                dt        = pageControl.GetList_FenYe_Common(SQLCondition(), pageindex, GridView1.PageSize, alltiaoshuInt, "vCash_Apply2", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (dt.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中
                    Button_sumbit.Enabled   = true;
                    Button_Complete.Enabled = true;
                    GridView1.Visible       = true;
                    GridView1.DataSource    = dt; //指定GridView1的数据是dv
                    GridView1.DataBind();         //将上面指定的信息绑定到GridView1上
                    notice.Text = "";

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                    //设置选中日期的合计金额
                    DataTable dt2 = new DataTable();
                    dt2 = pageControl.doSql("select*from vCash_Apply2 where " + SQLCondition()).Tables[0];
                    float daishenhe  = 0;
                    float tongguo    = 0;
                    float weitongguo = 0;
                    float wancheng   = 0;
                    for (int i = 0; i < dt2.Rows.Count; i++)
                    {
                        int staue = int.Parse(dt2.Rows[i]["Statas"].ToString());
                        switch (staue)
                        {
                        //待审核金额
                        case 0:
                            daishenhe += float.Parse(dt2.Rows[i]["ApplyCount"].ToString());
                            break;

                        //审核通过金额
                        case 1:
                            tongguo += float.Parse(dt2.Rows[i]["ApplyCount"].ToString());
                            break;

                        //审核未通过金额
                        case 2:
                            weitongguo += float.Parse(dt2.Rows[i]["ApplyCount"].ToString());
                            break;

                        //审核完成金额
                        case 3:
                            wancheng += float.Parse(dt2.Rows[i]["ApplyCount"].ToString());
                            break;
                        }
                    }
                    Label_money1.Text = daishenhe.ToString();
                    Label_money2.Text = tongguo.ToString();
                    Label_money3.Text = weitongguo.ToString();
                    Label_money4.Text = wancheng.ToString();
                }
                else
                {
                    Button_sumbit.Enabled   = false;
                    Button_Complete.Enabled = false;
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!";
                    Label_money1.Text       = "0";
                    Label_money2.Text       = "0";
                    Label_money3.Text       = "0";
                    Label_money4.Text       = "0";

                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    if (alltiaoshuInt > 0)
                    {
                        BindData(pageindex - 1);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 显示项目的列表信息
        /// </summary>
        /// <param name="pageindex">页码</param>
        /// <param name="projectname">项目名称</param>
        /// <param name="leadername">项目负责人</param>
        /// <param name="depart">参与部门</param>
        /// <param name="starttime">开始时间</param>
        /// <param name="endtime">对束时间</param>
        protected void ShowListInfo(int pageindex, string projectname, string leadername, string depart, string starttime, string endtime)
        {
            try
            {
                get_Cash_Cards();

                DataTable DT        = new DataTable();
                string    sqlWhere1 = " (Status=1 or Status=3 or Status=5) and DELFLAG = 0 ";

                //项目名称
                if (null != projectname && !projectname.Equals(""))
                {
                    sqlWhere1 = sqlWhere1 + " AND NAMES LIKE '%" + projectname + "%' ";
                }

                //项目负责人
                if (null != leadername && !leadername.Equals(""))
                {
                    sqlWhere1 = sqlWhere1 + " AND ( LeaderRealName LIKE '%" + leadername + "%' OR LeaderUserName LIKE '%" + leadername + "%' )";
                }

                //参与部门
                if (null != depart && !depart.Equals(""))
                {
                    sqlWhere1 = sqlWhere1 + " AND DepartmentNames LIKE '%" + depart + "%' ";
                }

                //开始时间
                if (null != starttime && !starttime.Equals(""))
                {
                    sqlWhere1 = sqlWhere1 + " AND StartTime >='" + Convert.ToDateTime(starttime) + "'";
                }

                //结束时间
                if (null != endtime && !endtime.Equals(""))
                {
                    sqlWhere1 = sqlWhere1 + " AND EndTime <='" + Convert.ToDateTime(endtime) + "'";
                }

                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "vProject_Projects", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中

                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                   //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString(); //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                         //将上面指定的信息绑定到GridView1上
                    Button_modify.Enabled        = true;
                    Button_delete.Enabled        = true;
                    Button_projectsearch.Enabled = true;
                    tag.Text = "";

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text             = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible            = false;
                    notice.Text                  = "*没有符合条件的结果!";
                    pageControlShow.Visible      = false;//如果记录集为空,则不显示分页控件
                    Button_modify.Enabled        = false;
                    Button_delete.Enabled        = false;
                    Button_projectsearch.Enabled = false;
                    if (alltiaoshuInt > 0)
                    {
                        ShowListInfo(pageindex - 1, projectname, leadername, depart, starttime, endtime);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 12
0
        /// <summary>
        ///显示待审核的项目列表信息
        /// </summary>
        /// <param name="pageindex"></param>
        protected void ShowListInfo(int pageindex, string status)
        {
            try
            {
                DataTable DT = new DataTable();

                mUserPower = (Model.userPower)Session["Session_Power"];

                string sqlWhere1 = " DELFLAG = 0 and PDEL=0";
                if (mUserPower.isYinLeader.Equals("1") || status == "0" || status == "3")
                {
                    sqlWhere1 += " and DoUserID='" + mUserPower.userid + "'";
                }
                //if ((null != status && status.Equals("0")) || null != status && status.Equals("3"))
                //{
                //    sqlWhere1 = sqlWhere1 + " AND Status=" + status;

                //}
                //else
                //{
                //    sqlWhere1 = sqlWhere1 + " AND (Status=1 or Status=2)";
                //}

                if (null != status)
                {
                    sqlWhere1 = sqlWhere1 + " AND Status=" + status;
                }

                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "vProject_Apply_OrderSignet", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中

                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                   //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString(); //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                         //将上面指定的信息绑定到GridView1上
                    Button_check.Enabled = true;
                    tag.Text             = "";

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text             = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    Button_check.Enabled    = false;
                    if (alltiaoshuInt > 0)
                    {
                        ShowListInfo(pageindex - 1, status);
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 显示项目下的任务
        /// </summary>
        protected void ShowTaskList(int pageindex)
        {
            try
            {
                DataTable        DT         = new DataTable();
                string           sqlWhere1  = "";
                Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];

                if (DDL_Status.SelectedValue.ToString().Equals(""))
                {
                    sqlWhere1 = "DELFLAG=0 and ProjectID=" + Session["Work_ProjectId"];
                }
                else
                {
                    sqlWhere1 = "DELFLAG=0 and ProjectID=" + Session["Work_ProjectId"] + " and Status=" + DDL_Status.SelectedValue;
                }
                //必须是登陆者参与的项目或者登陆者自己创建的项目登陆者才能看到。
                // sqlWhere1 = sqlWhere1 + " AND  (UserInfo LIKE '%" + user_model.REALNAME + "(" + user_model.USERNAME + ")" + "%' OR SendUserID ='" + user_model.ID + "') ";

                //根据2010年12月14日的需求,要所有人都能看到任务,但是没有参与的人员,则不给可以选择的按钮
                HiddenField_userid.Value   = user_model.ID;
                HiddenField_userinfo.Value = user_model.REALNAME + "(" + user_model.USERNAME + ")";


                sqlWhere1 = sqlWhere1;

                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "Project_Task", "StartTime").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中

                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                                                                                                                                                     //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString();                                                                                                                                   //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                                                                                                                                                           //将上面指定的信息绑定到GridView1上

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text                = "";
                    pageControlShow.Visible    = true;                                                                                                                                              //如果记录集不为空,则显示分页控件
                    Button_modify.Enabled      = true;
                    Button_delete.Enabled      = true;
                    Button_setfinish.Enabled   = true;
                    Button_setpostpone.Enabled = true;
                    //设置项目操作按钮状态
                    if (DDL_Status.SelectedValue == "0")
                    {
                    }
                    else if (DDL_Status.SelectedValue == "2")
                    {
                        Button_setfinish.Enabled   = false;
                        Button_modify.Enabled      = false;
                        Button_setpostpone.Enabled = false;
                    }
                    else
                    {
                        Button_setpostpone.Enabled = false;
                    }
                }
                else
                {
                    GridView1.Visible        = false;
                    notice.Text              = "*没有符合条件的结果!请选择筛选的条件!";
                    pageControlShow.Visible  = false;//如果记录集为空,则不显示分页控件
                    Button_modify.Enabled    = false;
                    Button_delete.Enabled    = false;
                    Button_setfinish.Enabled = false;
                    //Button_setunderway.Enabled = false;
                    Button_setpostpone.Enabled = false;
                    if (alltiaoshuInt > 0 && pageindex > 1)
                    {
                        ShowTaskList(pageindex - 1);
                    }
                }
            }
            catch
            {
                GridView1.Visible       = false;
                notice.Text             = "*进入任务列表时发生错误!";
                pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                Button_modify.Enabled   = false;
                Button_delete.Enabled   = false;
            }
        }
Exemplo n.º 14
0
        /// <summary>
        ///显示待审核的项目列表信息
        /// </summary>
        /// <param name="pageindex"></param>
        protected void ShowListInfo(int pageindex, string status)
        {
            try
            {
                get_Cash_Cards();

                Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"];
                DataTable        DT         = new DataTable();
                string           sqlWhere1  = " DELFLAG = 0 ";

                if (null != status && !status.Equals(""))
                {
                    if (status.Equals("9"))
                    {
                        sqlWhere1 = sqlWhere1 + " AND (ID IN (SELECT ProjectID FROM Project_ShenheList WHERE (UserID = '" + user_model.ID + "') AND (Isturn = 2) AND (Status = 0))) ";
                    }
                    else//如果查看的是待审或是不通的项目,只有在新建项目时所选择的审核人才能查看这些项目
                    {
                        sqlWhere1 = sqlWhere1 + " AND Status=" + status;
                        //只有在新建项目时所选择的审核人才能查看这些项目
                        sqlWhere1 = sqlWhere1 + " AND (DoUserID = '" + user_model.ID + "')";
                    }
                }
                else
                {
                    sqlWhere1 = sqlWhere1 + " AND (Status=0 or Status=2)";
                    //只有在新建项目时所选择的审核人才能查看这些项目
                    sqlWhere1 = sqlWhere1 + " AND (DoUserID = '" + user_model.ID + "')";
                }

                string allTiaoshu    = dtrowsHidden.Value.ToString();//获取到所有的条数
                int    alltiaoshuInt = int.Parse(allTiaoshu);
                DT        = pageControl.GetList_FenYe_Common(sqlWhere1, pageindex, GridView1.PageSize, alltiaoshuInt, "vProject_Projects", "ID").Tables[0];
                pageindex = pageControl.pageindex(pageindex, GridView1.PageSize, alltiaoshuInt);//获取当前要显示的页码数【如果最后一页的最后一条记录被删除后,还能正常显示】
                if (DT.Rows.Count > 0)
                {
                    //当获取到的数据集不为空的时候,显示在GridView1中

                    GridView1.Visible     = true;
                    GridView1.DataSource  = DT;                   //指定GridView1的数据是DT
                    pageindexHidden.Value = pageindex.ToString(); //给隐藏的页码变量赋值,给下面的分页控件提供数据
                    GridView1.DataBind();                         //将上面指定的信息绑定到GridView1上
                    Button_check.Enabled = true;
                    tag.Text             = "";

                    pageControl.SetSelectPage(pageindex, int.Parse(dtrowsHidden.Value.ToString()), DropDownList2, GridView1.PageSize, FirstPage, NextPage, PreviousPage, LastPage, Label_showInfo); //加载通用组件里面的分页函数
                    notice.Text             = "";
                    pageControlShow.Visible = true;                                                                                                                                                 //如果记录集不为空,则显示分页控件
                }
                else
                {
                    GridView1.Visible       = false;
                    notice.Text             = "*没有符合条件的结果!";
                    pageControlShow.Visible = false;//如果记录集为空,则不显示分页控件
                    Button_check.Enabled    = false;
                    if (alltiaoshuInt > 0)
                    {
                        ShowListInfo(pageindex - 1, status);
                    }
                }
            }
            catch
            {
            }
        }