Ejemplo n.º 1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="WorkFlowID"></param>
        /// <param name="pageInde"></param>
        private void BindGrid(int pageIndex)
        {
            BLL.T_WorkFlow_BLL   wfBLL = new T_WorkFlow_BLL();
            Model.T_WorkFlow_MDL wfMDL = wfBLL.GetModel(workFlowID);
            workFlowCode = wfMDL.WorkFlowCode;

            string sqlWhere = string.Empty;

            if (PublicModel.isSuperAdmin())                                                             //管理员管理员获取所有工程
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("AREA_CODE") + "%'";     //加区域了。
            }
            else if (PublicModel.isArchiveUser())                                                       //档案馆用户看自己的
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("OLD_AREA_CODE") + "%'"; //加区域了。
            }

            if (!String.IsNullOrEmpty(txtGcmc.Text))
            {
                sqlWhere += " AND gcmc like '%" + txtGcmc.Text + "%'";
            }
            if (!String.IsNullOrEmpty(txtGcbm.Text))
            {
                sqlWhere += " AND gcbm like '%" + txtGcbm.Text + "%'";
            }
            DataTable dt = null;

            if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0)
            {
                pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex"));
                ViewState["CurrentPageIndex"] = pageIndex;
            }
            else
            {
                pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]);
            }

            if (PublicModel.isSuperAdmin())
            {
                dt = flowDefineBLL.GetLHSignatureListPaging(workFlowID.ToString(), false, "", "", sqlWhere, pageSize, pageIndex, out itemCount);
            }
            else
            {
                dt = flowDefineBLL.GetLHSignatureListPaging(workFlowID.ToString(), Common.Session.GetSessionBool("IsCompany"),
                                                            Common.Session.GetSession("RoleID"), Common.Session.GetSession("UserID"), sqlWhere, pageSize, pageIndex, out itemCount);
            }

            AspNetPager.AlwaysShow = true;
            AspNetPager.PageSize   = pageSize;

            AspNetPager.RecordCount      = itemCount;
            AspNetPager.CurrentPageIndex = pageIndex;

            gvData.DataSource = dt;
            gvData.DataBind();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据流程编号返回流程ID
        /// </summary>
        /// <param name="workFlowCode"></param>
        /// <param name="companyID"></param>
        /// <returns></returns>
        public static int getWorkFlowIdByWorkFlowCode(string workFlowCode, int companyID = 0)
        {
            T_WorkFlow_BLL workFlowBLL = new T_WorkFlow_BLL();
            string         strWhere    = " lower(WorkFlowCode)='" + workFlowCode.ToLower() + "' ";

            if (companyID > 0)
            {
                strWhere += "and CompanyID=" + companyID;
            }
            T_WorkFlow_MDL workFlowMDL = workFlowBLL.GetModelList(strWhere).ToList().FirstOrDefault();

            return(workFlowMDL == null ? 0 : workFlowMDL.WorkFlowID);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="WorkFlowID"></param>
        /// <param name="pageInde"></param>
        private void BindGrid(int pageIndex)
        {
            T_WorkFlow_BLL wfBLL = new T_WorkFlow_BLL();
            T_WorkFlow_MDL wfMDL = wfBLL.GetModel(workFlowID);

            workFlowCode = wfMDL.WorkFlowCode;

            string sqlWhere = string.Empty;

            if (Common.ConvertEx.ToBool(Common.Session.GetSession("SuperAdmin")) == true)                                                                               //管理员管理员获取所有工程
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Session["AREA_CODE"].ToString() + "%'";                                                                            //加区域了。
            }
            else if (Common.ConvertEx.ToBool(Common.Session.GetSession("SuperAdmin")) == false && Common.Session.GetSession("IsCompany") == false.ToString().ToLower()) //档案馆用户看自己的
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Session["OLD_AREA_CODE"].ToString() + "%'";                                                                        //加区域了。
            }

            if (!String.IsNullOrEmpty(gcmc.Text))
            {
                sqlWhere += " AND gcmc like '%" + gcmc.Text + "%'";
            }
            if (!String.IsNullOrEmpty(gcbm.Text))
            {
                sqlWhere += " AND gcbm like '%" + gcbm.Text + "%'";
            }

            DataTable dt = null;

            if (Common.Session.GetSession("SuperAdmin").ToLower() == "true")
            {
                dt = flowDefineBLL.GetListPaging(workFlowID.ToString(), false, "", "", sqlWhere, pageSize, pageIndex, out itemCount);
            }
            else
            {
                dt = flowDefineBLL.GetListPaging(workFlowID.ToString(), Common.Session.GetSessionBool("IsCompany"),
                                                 Common.Session.GetSession("RoleID"), Common.Session.GetSession("UserID"), sqlWhere, pageSize, pageIndex, out itemCount);
            }

            AspNetPager.AlwaysShow = true;
            AspNetPager.PageSize   = pageSize;

            AspNetPager.RecordCount = itemCount;

            gvData.DataSource = dt;
            gvData.DataBind();
        }
Ejemplo n.º 4
0
        public string AllotSingleProject(string SingleProjectID, string ChargeUserID, string WorkFlowID)
        {
            try {
                //激活工程
                T_SingleProject_MDL singleProjectMDL = singleProjectBLL.GetModel(ConvertEx.ToInt(SingleProjectID));

                singleProjectMDL.Status = 1;
                int CompanyID = 0;

                #region 没有工程编号则生成
                if (String.IsNullOrEmpty(singleProjectMDL.gcbm))
                {
                    T_Other_BLL otherBLL = new T_Other_BLL();
                    singleProjectMDL.gcbm = otherBLL.GetNewEngineerID();
                    singleProjectBLL.Update(singleProjectMDL);       //产生工程号

                    T_Construction_Project_BLL       cpBLL = new T_Construction_Project_BLL();
                    Model.T_Construction_Project_MDL cpMDL = cpBLL.GetModel(singleProjectMDL.ConstructionProjectID);
                    if (cpMDL != null)
                    {
                        CompanyID = cpMDL.CompanyID;                  //建设单位ID
                        if (String.IsNullOrEmpty(cpMDL.xmh))
                        {
                            cpMDL.xmh = otherBLL.GetNewProjectID();
                            cpBLL.Update(cpMDL);                      //更新项目号
                        }
                    }
                }
                #endregion

                #region 激活用户
                T_UsersInfo_BLL userBLL = new T_UsersInfo_BLL();
                T_UsersInfo_MDL userMDL = userBLL.GetModel(singleProjectMDL.CompanyUserID);
                if (userMDL != null)
                {
                    userMDL.IsValid = true;
                    userBLL.Update(userMDL);
                }
                #endregion

                #region 修改工程分配信息
                if (singleProjectMDL != null)
                {
                    singleProjectMDL.AllotDate    = DateTime.Now;                                         //分配时间
                    singleProjectMDL.AllotUserID  = ConvertEx.ToInt(Common.Session.GetSession("UserId")); //分配人员
                    singleProjectMDL.ChargeUserID = ConvertEx.ToInt(ChargeUserID);                        //业务指导人员

                    singleProjectBLL.Update(singleProjectMDL);
                }
                #endregion

                #region 添加建设单位归档目录
                string iSignaturePdf      = "0"; //文件是否需要签章
                string iSignatureWorkFlow = "0"; //是否按签章流程签章
                if (ConvertEx.ToBool(SystemSet._ISIGNATUREPDF))
                {
                    iSignaturePdf      = "1";
                    iSignatureWorkFlow = "1";
                }
                new UserOperate().CopyFileList(CompanyID, singleProjectMDL.CompanyUserID, "",
                                               singleProjectMDL.SingleProjectID, singleProjectMDL.ProjectType, iSignaturePdf, iSignatureWorkFlow);
                #endregion

                #region 把业务指导人员用户加入到这个工程用户中去
                T_UsersInfo_MDL ChargeUserMDL = userBLL.GetModel(Common.ConvertEx.ToInt(ChargeUserID));
                PublicModel.AddSingleProjectUser(singleProjectMDL.SingleProjectID, ChargeUserMDL);
                #endregion

                #region 相关流程的用户也需要加入,否则流程走不下去===现在有了受理,可以达到这个功能,不需要加了。让用户受理下来。受理还没做完呢?
                SingleProjectUser  projectRole = new SingleProjectUser();
                BLL.T_WorkFlow_BLL workFlowBLL = new T_WorkFlow_BLL();
                DataSet            workFlowDS  = workFlowBLL.GetList(" OrderIndex=1 ");
                if (workFlowDS.Tables.Count > 0)
                {
                    foreach (DataRow row in workFlowDS.Tables[0].Rows)
                    {
                        projectRole.Update(singleProjectMDL.SingleProjectID, Common.ConvertEx.ToInt(row["RoleID"]), Common.ConvertEx.ToInt(row["UserID"]));
                    }
                }
                #endregion

                #region 发送邮件通知客户
                if (SystemSet._ACCEPTSINGLE_SENDEMAILFLAG)
                {
                    string strMsgBody = "您好!<br />";
                    strMsgBody += "您报建的工程:" + singleProjectMDL.gcmc + ",已确认通过,产生的工程编号是:" +
                                  singleProjectMDL.gcbm + ",您现在已经可以通过注册时的账号密码登记系统操作了!";

                    T_UsersInfo_MDL CompanyUserMDL = userBLL.GetModel(singleProjectMDL.CompanyUserID);
                    Common.CSendEmail.SendEmail("档案馆", CompanyUserMDL.EMail, "工程报建确认通知", strMsgBody, "");
                }
                #endregion

                #region  提交到下一个流程
                WorkFlowManage workflowmanage = new WorkFlowManage();
                workflowmanage.GoNextProjectWorkFlowSataus(singleProjectMDL.SingleProjectID, ConvertEx.ToInt(WorkFlowID));
                #endregion

                #region 将指导人员指导环节的所有 [受理]全部 做,这样,除了管理员和受理人员外,其他人都看不到流程下的工程
                T_WorkFlowDefine_BLL         workFlowDefineBLL = new T_WorkFlowDefine_BLL();
                IList <T_WorkFlowDefine_MDL> workFlowDefineLT  = workFlowDefineBLL.GetModelList(" SingleProjectID=" +
                                                                                                singleProjectMDL.SingleProjectID + " and WorkFlowID in(" + SystemSet._DEFAULT_RECV_WORKFLOWID + ") ");
                if (workFlowDefineLT != null && workFlowDefineLT.Count > 0)
                {
                    foreach (T_WorkFlowDefine_MDL wkdMDL in workFlowDefineLT)
                    {
                        wkdMDL.SubmitStatus = 2;//受理完成状态
                        wkdMDL.RecvUserID   = Common.ConvertEx.ToInt(ChargeUserID);
                        wkdMDL.RecvDateTime = DateTime.Now;
                        workFlowDefineBLL.Update(wkdMDL);
                    }
                }
                #endregion

                return(singleProjectMDL.gcbm);
            } catch (Exception ex) {
                return(SystemSet._RETURN_FAILURE_VALUE + ex.Message);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="pageIndex"></param>
        private void BindGrid(int pageIndex)
        {
            BLL.T_WorkFlow_BLL   wfBLL = new T_WorkFlow_BLL();
            Model.T_WorkFlow_MDL wfMDL = wfBLL.GetModel(ConvertEx.ToInt(workFlowID));
            workFlowCode = wfMDL.WorkFlowCode;

            string sqlWhere = string.Empty;

            if (PublicModel.isSuperAdmin())       //管理员管理员获取所有工程
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("AREA_CODE") + "%'";
            }
            else if (PublicModel.isArchiveUser()) //档案馆用户看自己的
            {
                sqlWhere = " AND AREA_CODE LIKE '" + Common.Session.GetSession("OLD_AREA_CODE") + "%'";
            }

            if (!String.IsNullOrEmpty(gcmc.Text))
            {
                sqlWhere += " AND gcmc like '%" + gcmc.Text + "%'";
            }
            if (!String.IsNullOrEmpty(gcbm.Text))
            {
                sqlWhere += " AND gcbm like '%" + gcbm.Text + "%'";
            }

            if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0)
            {
                pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex"));
                ViewState["CurrentPageIndex"] = pageIndex;
            }
            else
            {
                pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]);
            }

            bool isChargeUser = false;

            if ((SystemSet._DEFAULT_RECV_WORKFLOWID + ",").IndexOf(workFlowID + ",") > -1)
            {
                isChargeUser = true;
            }

            DataTable dt = null;

            if (PublicModel.isSuperAdmin())
            {
                dt = flowDefineBLL.GetListPaging(workFlowID, false, "", "", sqlWhere, pageSize, pageIndex, out itemCount);
            }
            else
            {
                dt = flowDefineBLL.GetListPaging(workFlowID, Common.Session.GetSessionBool("IsCompany"),
                                                 "", Common.Session.GetSession("UserID"), sqlWhere, pageSize, pageIndex, out itemCount, isChargeUser);
            }

            AspNetPager.AlwaysShow = true;
            AspNetPager.PageSize   = pageSize;

            AspNetPager.RecordCount      = itemCount;
            AspNetPager.CurrentPageIndex = pageIndex;

            rpData.DataSource = dt;
            rpData.DataBind();
        }