예제 #1
0
        public string HookUpCompanyAndUser(int SingleProjectID, int UserID, int RoleID,
                                           int CompanyID, string ProjectType, string UserName, string CompanyType)
        {
            string flag = SystemSet._RETURN_SUCCESS_VALUE;

            try {
                string iSignaturePdf      = "0"; //文件是否需要签章
                string iSignatureWorkFlow = "0"; //是否按签章流程签章
                if (ConvertEx.ToBool(SystemSet._ISIGNATUREPDF))
                {
                    iSignaturePdf      = "1";
                    iSignatureWorkFlow = "1";
                }

                PublicModel.AddSingleProjectUser(SingleProjectID, RoleID, UserID);                                                                //加入到工程用户表中去
                PublicModel.AddSingleProjectCompany(SingleProjectID, CompanyID);                                                                  //加入到工程公司表中去
                userOper.CopyFileList(CompanyID, UserID, UserName, SingleProjectID, ProjectType, CompanyType, iSignaturePdf, iSignatureWorkFlow); //用户添加归档目录

                #region 关联更新工程表的 施工,监理单位信息
                T_SingleProject_MDL singleMDL  = singleBLL.GetModel(SingleProjectID);
                T_Company_MDL       companyMDL = companyBLL.GetModel(CompanyID);
                if (singleMDL != null && companyMDL != null)
                {
                    if (ConvertEx.ToInt(CompanyType) == SystemSet._SGCOMPANYINFO)
                    {
                        singleMDL.sgdw = companyMDL.CompanyName;
                    }
                    else if (ConvertEx.ToInt(CompanyType) == SystemSet._JLCOMPANYINFO)
                    {
                        singleMDL.jldw = companyMDL.CompanyName;
                    }
                    singleBLL.Update(singleMDL);
                }
                #endregion
            } catch (Exception ex) {
                flag = SystemSet._RETURN_FAILURE_VALUE + ex.Message;
                Common.LogUtil.Debug(this, "工程相关表关联(工程用户表,工程公司表)", ex);
            }
            return(flag);
        }