Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            T_Construction_Project_BLL projectbll = new T_Construction_Project_BLL();
            T_Construction_Project_MDL obj        = new T_Construction_Project_MDL();

            obj = ctrlConstructionBaseInfo1.GetModule(Common.ConvertEx.ToInt(Common.DNTRequest.GetQueryString("ID")));
            //object obj = Comm.GetValueToObject(tmdl1, table1);
            int SingleProjectID = 0;

            if (obj != null)
            {
                T_Construction_Project_MDL newprojectmdl = (T_Construction_Project_MDL)obj;
                newprojectmdl.jgrq = DateTime.Now;
                if (((CommonEnum.PageState)ViewState["ps"]) == CommonEnum.PageState.ADD)
                {
                    newprojectmdl.CompanyID = Common.ConvertEx.ToInt(Common.Session.GetSession("CompanyID"));

                    //Leo 新增时,需要自动产生项目号
                    T_Other_BLL otherBLL = new T_Other_BLL();
                    newprojectmdl.xmh = otherBLL.GetNewProjectID();

                    SingleProjectID = projectbll.Add(newprojectmdl);
                    PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(),
                                         string.Concat("T_Construction_Project;key=", SingleProjectID, ";xmmc=", newprojectmdl.xmmc));
                }
                else
                {
                    projectbll.Update(newprojectmdl);
                    PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(),
                                         string.Concat("T_Construction_Project;key=", newprojectmdl.ConstructionProjectID, ";xmmc=", newprojectmdl.xmmc));
                }
            }
            Common.MessageBox.CloseLayerOpenWeb(this.Page);
        }
        public T_Construction_Project_MDL GetModule(int tconstructionprojectid)
        {
            T_Construction_Project_MDL mdl = new T_Construction_Project_MDL();

            if (tconstructionprojectid > 0)
            {
                BLL.T_Construction_Project_BLL bll = new T_Construction_Project_BLL();
                mdl = bll.GetModel(tconstructionprojectid);
            }
            object obj = Comm.GetValueToObject(mdl, table1);

            return((T_Construction_Project_MDL)obj);
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(SubmitToReadyCheck));
            if (!IsPostBack)
            {
                NewGUID = Guid.NewGuid() + ".cll";
                Session["CellTempGUID"] = NewGUID;
                SingleProjectID         = Common.DNTRequest.GetQueryString("SingleProjectID");
                T_SingleProject_MDL        SingProMdl = new T_SingleProject_BLL().GetModel(Common.ConvertEx.ToInt(SingleProjectID));
                T_Construction_Project_MDL ConProMdl  = new T_Construction_Project_BLL().GetModel(Common.ConvertEx.ToInt(SingProMdl.ConstructionProjectID));
                if (ConProMdl != null)
                {
                    CompanyID             = Common.ConvertEx.ToString(ConProMdl.CompanyID);
                    ConstructionProjectID = Common.ConvertEx.ToString(ConProMdl.ConstructionProjectID);
                }

                string Action = Common.DNTRequest.GetString("Action");

                Session["Tmp_Action"]          = Action;
                Session["Tmp_SingleProjectID"] = SingleProjectID;
                Session["Tmp_WorkFlowID"]      = Common.DNTRequest.GetString("WorkFlowID");


                if (Action == "Add")
                {//申请
                    //弹出申请单,用户填写完成后,保存
                    ClientScript.RegisterStartupScript(this.GetType(), "IsSuccess", "<script type=\"text/javascript\">ShowButton('Button1','Button2');</script>");
                }
                else if (Action == "Recv")
                {//受理
                    //弹出申请单,用户只是查看一下,无需保存
                    ClientScript.RegisterStartupScript(this.GetType(), "IsSuccess", "<script type=\"text/javascript\">ShowButton('Button2','Button1');</script>");
                }

                string CellName = Common.DNTRequest.GetString("CellName");
                cellFilePath = "http://" + Request.Url.Authority + "/Upload/SubmitCell/" + CellName; //华表模板路径

                if (CellName.IndexOf("Model=1") > -1)                                                //表明是第一次
                {
                    FirstFlag = 1;
                }
            }
        }
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
        //string EFileStartPath = Common.Common.EFileStartPath;

        protected void Page_Load(object sender, EventArgs e)
        {
            StartPath = Common.Common.EFileStartPath.Remove(0, 2).Replace('\\', '/');
            if (!this.IsPostBack)
            {
                MyAddInit();

                SingleProjectID = Request.QueryString["ProNo"];
                BLL.T_EFile_BLL   bll      = new DigiPower.Onlinecol.Standard.BLL.T_EFile_BLL();
                Model.T_EFile_MDL efileMDL = new DigiPower.Onlinecol.Standard.Model.T_EFile_MDL();
                efileMDL = bll.GetModel(Common.ConvertEx.ToInt(ID));

                if (efileMDL != null)
                {
                    FileListID           = efileMDL.FileListID;
                    ArchiveListCellRptID = efileMDL.ArchiveListCellRptID;//给前面用的


                    //T_SingleProject_MDL SingProMdl = new T_SingleProject_BLL().GetModel(Common.ConvertEx.ToInt(SingleProjectID));
                    //T_Construction_Project_MDL ConProMdl = new T_Construction_Project_BLL().GetModel(Common.ConvertEx.ToInt(SingProMdl.ConstructionProjectID));
                    //if (ConProMdl != null)
                    //{
                    //    CompanyID = Common.ConvertEx.ToString(ConProMdl.CompanyID);
                    //    ConstructionProjectID = Common.ConvertEx.ToString(ConProMdl.ConstructionProjectID);
                    //}
                    //判断,如果华表是第一次则根据华表模板的路径读取华表
                    //否则直接读取电子文件的FilePath
                    if (Common.ConvertEx.ToInt(efileMDL.Status) == 0)
                    {
                        T_CellTmp_MDL ctMdl = new T_CellTmp_BLL().GetModel(Common.ConvertEx.ToInt(efileMDL.FilePath));
                        cellFilePath = "http://" + Request.ServerVariables["HTTP_HOST"] + "/" + ctMdl.FilePath.Substring(1).Replace(@"\", @"/");     //华表模板路径

                        string tempFileID = Guid.NewGuid().ToString() + ".cll";

                        //string cellPath = Server.MapPath(string.Concat(StartPath,"CellEFile/"

                        //CreateDirectory(StartPath + "CellEFile/" +  + "/", true);
                        CreateDirectory(string.Concat(StartPath, "/", SingleProjectID, "/CellEFile/"), true);

                        NewCellFilePath     = string.Concat("/CellEFile/", tempFileID);                             //新华表存储路径
                        NewCellFullFilePath = string.Concat(StartPath, SingleProjectID, "/CellEFile/", tempFileID); //新华表存储路径
                    }
                    else if (Common.ConvertEx.ToInt(efileMDL.Status) == 1)
                    {
                        if (System.IO.File.Exists(Server.MapPath(string.Concat(StartPath, SingleProjectID, "/", efileMDL.FilePath))))
                        {
                            //Leo 存了绝对路径。等easyPDF好了,再回来来决定
                            cellFilePath = "http://" + Request.ServerVariables["HTTP_HOST"] +
                                           string.Concat(StartPath, SingleProjectID, "/", efileMDL.FilePath);
                            NewCellFilePath     = efileMDL.FilePath;
                            NewCellFullFilePath = string.Concat(StartPath, SingleProjectID, "/", efileMDL.FilePath);
                        }
                    }
                    try
                    {
                        string Action = Request.QueryString["Action"];
                        if (Action == "Show")
                        {
                            T_CellTmp_MDL ctMdl = new T_CellTmp_BLL().GetModel(Common.ConvertEx.ToInt(ID));
                            cellFilePath          = "http://" + Request.ServerVariables["HTTP_HOST"] + "/" + ctMdl.FilePath.Substring(1).Replace(@"\", @"/");
                            CompanyID             = "10";
                            ConstructionProjectID = "10";
                            return;
                        }
                    }
                    catch { }

                    T_SingleProject_MDL        SingProMdl = new T_SingleProject_BLL().GetModel(Common.ConvertEx.ToInt(SingleProjectID));
                    T_Construction_Project_MDL ConProMdl  = new T_Construction_Project_BLL().GetModel(Common.ConvertEx.ToInt(SingProMdl.ConstructionProjectID));
                    if (ConProMdl != null)
                    {
                        CompanyID             = Common.ConvertEx.ToString(ConProMdl.CompanyID);
                        ConstructionProjectID = Common.ConvertEx.ToString(ConProMdl.ConstructionProjectID);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try {
                #region 建设单位信息
                T_Company_MDL companyMDL = new T_Company_MDL();

                companyMDL              = Comm.GetValueToObject(companyMDL, table_Company) as T_Company_MDL;
                companyMDL.CreateDate   = DateTime.Now;
                companyMDL.IsCompany    = true;
                companyMDL.CreateIP     = Common.DNTRequest.GetIP();
                companyMDL.CreateUserID = 0;//公司创建人

                int companyID = companyBLL.Add(companyMDL);
                #endregion

                if (companyID > 0)
                {
                    #region 项目信息
                    T_Construction_Project_MDL cpModel = new T_Construction_Project_MDL();
                    T_Construction_Project_BLL cpBll   = new T_Construction_Project_BLL();

                    cpModel.CompanyID = companyID;                     //所属单位
                    cpModel.xmmc      = xmmc.Text;                     //项目名称
                    cpModel.xmh       = string.Empty;                  //项目号
                    if (jgsj.Text.Length > 0)
                    {
                        cpModel.jgrq = Common.ConvertEx.ToDate(jgsj.Text);  //开工时间
                    }
                    cpModel.jgsj        = jgsj.Text;
                    cpModel.ProjectType = ProjectType.SelectValue;
                    int constructionProjectID = cpBll.Add(cpModel);
                    #endregion

                    #region 工程信息
                    T_SingleProject_MDL singleProjectMDL = new T_SingleProject_MDL();

                    singleProjectMDL                       = Comm.GetValueToObject(singleProjectMDL, tablemain) as T_SingleProject_MDL;
                    singleProjectMDL.AREA_CODE             = AREA_CODE.SelectValue;
                    singleProjectMDL.ConstructionProjectID = constructionProjectID;
                    singleProjectMDL.CreateDate            = DateTime.Now;
                    singleProjectMDL.Status                = 0;                      //初始为0,未分配
                    singleProjectMDL.jsdw                  = companyMDL.CompanyName; //建设单位,是当前单位
                    singleProjectMDL.gcdd                  = gcdd.Text.Trim();
                    singleProjectMDL.WorkFlow_DoStatus     = 0;

                    int singleProjectID = singleProjectBLL.Add(singleProjectMDL); //工程ID
                    UploadFile(singleProjectID);                                  //上传证书

                    #endregion

                    #region 用户信息 ,角色默认给先前定义好的建设单位角色
                    T_UsersInfo_MDL userMDL = new T_UsersInfo_MDL();
                    userMDL               = (T_UsersInfo_MDL)Comm.GetValueToObject(userMDL, tLoginInfo);
                    userMDL.RoleID        = roleBLL.GetRoleIdByRoleCode(SystemSet._ROLECODE_JSCOMPANY, singleProjectMDL.AREA_CODE);
                    userMDL.Passwd        = DESEncrypt.Encrypt(Passwd.Text);
                    userMDL.UserType      = SystemSet.EumUserType.CompanyUser.ToString();
                    userMDL.UserName      = userMDL.LoginName;
                    userMDL.CompanyID     = companyID;
                    userMDL.Createdate    = DateTime.Now;
                    userMDL.LastLoginTime = DateTime.Now;
                    userMDL.IsLeader      = true;
                    userMDL.IsValid       = false;
                    userMDL.Createdby     = "工程报建产生";
                    int userID = userBLL.Add(userMDL);
                    #endregion

                    #region 添加工程用户关联信息
                    PublicModel.AddSingleProjectUser(singleProjectID, userMDL.RoleID, userID);
                    #endregion

                    #region 添加工程公司关联信息
                    PublicModel.AddSingleProjectCompany(singleProjectID, companyID);
                    #endregion

                    #region 添加工程流程环节
                    new T_WorkFlowDefine_BLL().AddWorkFlowDefine(singleProjectID, singleProjectMDL.AREA_CODE);
                    #endregion

                    #region 更新工程表的 CompanyUserID为当前建设单位用户ID
                    singleProjectMDL = singleProjectBLL.GetModel(singleProjectID);
                    singleProjectMDL.CompanyUserID = userID;
                    singleProjectBLL.Update(singleProjectMDL);
                    #endregion

                    #region 报建完成提示信息
                    this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "IsSuccess",
                                                                 "<script>"
                                                                 + " layer.alert('您已经成功注册,但您注册的信息,必需确认后才可以登录使用。请耐心等待,或致电:" + SystemSet._QUICKREGTEL + "', { btnAlign: 'c' }, function (i) {"
                                                                 + "     var index = parent.layer.getFrameIndex(window.name);"
                                                                 + "     parent.layer.close(index);"
                                                                 + "}); "
                                                                 + "</script>");
                    #endregion
                }
            } catch (Exception ex) {
                Common.LogUtil.Debug(this, "建设单位工程报建", ex);
                Common.MessageBox.FnLayerAlert(this.Page, "工程报建保存失败:" + ex.Message);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 将Model值赋给控件
        /// </summary>
        /// <param name="tSingleProjectID">工程ID</param>
        public void DataBindEx(int tSingleProjectID)
        {
            CTRL_AREA.BindDdlArea(true);
            ProjectType.DataBindEx();

            if (tSingleProjectID > 0)
            {
                T_SingleProject_MDL spMdl = new T_SingleProject_BLL().GetModel(tSingleProjectID); //获取工程Model
                Comm.SetValueToPage(spMdl, tablemain);                                            //将Model值赋给控件
                int ConstructionProjectID = Common.ConvertEx.ToInt(spMdl.ConstructionProjectID);  //获取项目ID
                gcdd.Text = spMdl.gcqy + spMdl.gcdd;

                if (ConstructionProjectID > 0)
                {
                    T_Construction_Project_MDL cpMdl = new T_Construction_Project_BLL().GetModel(ConstructionProjectID);
                    if (cpMdl != null)
                    {
                        int CompanyID = Common.ConvertEx.ToInt(cpMdl.CompanyID);                        //通过项目获取单位ID
                        if (CompanyID > 0)
                        {
                            T_Company_MDL cMdl = new T_Company_BLL().GetModel(CompanyID);
                            Comm.SetValueToPage(cMdl, table_Company);
                        }
                    }

                    StringBuilder ghxkz = new StringBuilder();
                    StringBuilder sgxkz = new StringBuilder();
                    StringBuilder other = new StringBuilder();

                    //获取工程对应的所有上传证件的附件
                    List <T_FileAttach_MDL> lt_ftMdl = new T_FileAttach_BLL().GetModelList("PriKeyValue=" + tSingleProjectID.ToString());
                    foreach (T_FileAttach_MDL ftMdl in lt_ftMdl)
                    {
                        if (ftMdl.AttachCode == "ghxkz")
                        {
                            ghxkz.Append("&nbsp;&nbsp;<a style=\"color:black;\" href=\"" + ftMdl.AttachPath + "\" title='点击查看' target=\"_blank\">" + ftMdl.AttachName + "</a>&nbsp;");
                        }
                        else if (ftMdl.AttachCode == "sgxkz")
                        {
                            sgxkz.Append("&nbsp;&nbsp;<a style=\"color:black;\" href=\"" + ftMdl.AttachPath + "\" title='点击查看' target=\"_blank\">" + ftMdl.AttachName + "</a>&nbsp;");
                        }
                        else if (ftMdl.AttachCode == "other")
                        {
                            other.Append("&nbsp;&nbsp;<a style=\"color:black;\" href=\"" + ftMdl.AttachPath + "\" title='点击查看' target=\"_blank\">" + ftMdl.AttachName + "</a>&nbsp;");
                        }
                    }
                    if (ghxkz.Length > 0)
                    {
                        ltghxkz.Text = ghxkz.ToString();
                    }
                    if (sgxkz.Length > 0)
                    {
                        ltsgxkz.Text = sgxkz.ToString();
                    }
                    if (other.Length > 0)
                    {
                        ltother.Text = other.ToString();
                    }
                }
            }
        }