Ejemplo n.º 1
0
        public string DeleteCompany(string CompanyID)
        {
            string flag = SystemSet._RETURN_SUCCESS_VALUE;

            try {
                T_Company_MDL companyMDL = compBLL.GetModel(ConvertEx.ToInt(CompanyID));
                if (companyMDL != null)
                {
                    T_SystemInfo_BLL systemInfoBLL = new T_SystemInfo_BLL();
                    if (companyMDL != null && companymdl.CompanyType != SystemSet._JSCOMPANYINFO)  //只删除监理和施工
                    {
                        compBLL.DeleteCompanyOther(CompanyID);

                        PublicModel.writeLog(SystemSet.EumLogType.DelData.ToString(), string.Concat("T_Company;key=", companyMDL.CompanyID,
                                                                                                    ";CompanyCode=", companyMDL.CompanyCode, ";CompanyType=", companyMDL.CompanyType,
                                                                                                    ";CompanyName=", companyMDL.CompanyName, ";删除公司及其关联表信息"));
                    }
                    else
                    {
                        flag = SystemSet._RETURN_FAILURE_VALUE + ":建设单位不能被删除!";
                    }
                }
            } catch (Exception ex) {
                flag = SystemSet._RETURN_FAILURE_VALUE + ex.Message;
                Common.LogUtil.Debug(this, "删除公司", ex);
            }
            return(flag);
        }
Ejemplo n.º 2
0
        //绑定归档目录
        private void BindGridView(int pageIndex)
        {
            Model.T_SingleProject_MDL spMDL = spBLL.GetModel(Common.ConvertEx.ToInt(SingleProjectID.Value));
            //singleProjectNo = spMDL.gcbm;

            //取当前工程的所有归档目录
            string strWhere = " SingleProjectID=" + SingleProjectID.Value;

            //不显示声像节点 //jdk 2014.11.16
            strWhere += " AND BH not like '%S%' ";

            if (Common.Session.GetSession("SuperAdmin").ToLower() == "true" ||
                Common.Session.GetSession("IsCompany") == false.ToString().ToLower())  //Leo 超级管理员看全部    档案馆的人也可以看全部
            {
                strWhere += " AND ((IsFolder=0) OR  (IsFolder=0 AND CONVERT_FLAG=1))";
            }
            else
            {
                if (!string.IsNullOrEmpty(companyID.Value) && companyID.Value != "0")
                {
                    Model.T_Company_MDL comMDL = comBLL.GetModel(Common.ConvertEx.ToInt(companyID.Value));

                    if (comMDL != null)
                    {
                        //strWhere += string.Format(" AND ((IsFolder=1 AND DefaultCompanyType={0})",
                        //    comMDL.CompanyType);
                        strWhere += string.Format(" AND (IsFolder=0 AND CompanyID={0} AND  CONVERT_FLAG=1) ",
                                                  comMDL.CompanyID);
                    }
                }
            }

            Session["FileInfostrWhere"] = strWhere;

            DataTable dt = fileBLL.GetListPaging(strWhere, pageSize, pageIndex, out itemCount);

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

            AspNetPager.RecordCount = itemCount;

            gvData.DataSource = dt;
            gvData.DataBind();
        }
        public void SetCompanyType(int UnderMyParentID, int CompanyId, bool isshowjs = false)
        {
            CompanyType.DataBindEx(UnderMyParentID, isshowjs);
            T_Company_MDL mdl = new T_Company_MDL();

            if (CompanyId > 0)
            {
                BLL.T_Company_BLL bll = new T_Company_BLL();
                mdl = bll.GetModel(CompanyId);
                CompanyType.SystemInfoID = mdl.CompanyType.ToString();
            }
        }
        public T_Company_MDL GetModule(int tCompanyID)
        {
            T_Company_MDL mdl = new T_Company_MDL();

            if (tCompanyID > 0)
            {
                BLL.T_Company_BLL bll = new T_Company_BLL();
                mdl = bll.GetModel(tCompanyID);
            }
            object obj = Comm.GetValueToObject(mdl, tbl_company);

            return((T_Company_MDL)obj);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 绑定页面
        /// </summary>
        /// <param name="ID"></param>
        private void BindPage(string ID)
        {
            T_Role_MDL model = new T_Role_MDL();

            model = roleBLL.GetModel(Convert.ToInt32(ID));
            if (model != null)
            {
                ViewState["model"] = model;
                object obj = Comm.SetValueToPage(model, this.tbl);

                BLL.T_Company_BLL compBLL = new T_Company_BLL();
                T_Company_MDL     compMDL = compBLL.GetModel(model.CompanyID);
                if (compBLL != null)
                {
                    CTRL_AREA.SelectValue = compMDL.AREA_CODE;
                }

                CompanyID.SelectValue = model.CompanyID.ToString();
            }
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 绑定归档目录
        /// </summary>
        /// <param name="pageIndex"></param>
        private void BindGridView(int pageIndex)
        {
            T_SingleProject_MDL spMDL = spBLL.GetModel(Common.ConvertEx.ToInt(singleProjectID));

            if (spMDL != null)
            {
                projectType = spMDL.ProjectType;

                string strWhere = " SingleProjectID=" + singleProjectID;
                strWhere += " AND BH not like '%S%' ";                      //不显示声像节点

                if (PublicModel.isSuperAdmin() || !PublicModel.isCompany()) //Leo 超级管理员看全部
                {
                }
                else if (spMDL != null && spMDL.CompanyUserID == Common.ConvertEx.ToInt(Common.Session.GetSession("UserID")))    //Leo 工程管理员也看全部,档案馆的人也可以看全部
                {
                }
                else
                {
                    strWhere += " AND operateuserid=" + Common.Session.GetSession("UserID");
                }

                if (!String.IsNullOrWhiteSpace(txtMyCode.Text.Trim()))
                {
                    strWhere += " AND MyCode LIKE '%" + txtMyCode.Text.Trim() + "%'";
                }
                if (!String.IsNullOrWhiteSpace(txtTitle.Text.Trim()))
                {
                    strWhere += " AND TITLE LIKE '%" + txtTitle.Text.Trim() + "%'";
                }
                if (!String.IsNullOrWhiteSpace(rdbFileStatus.SelectValue) && rdbFileStatus.SelectValue != "0")
                {
                    strWhere += " AND Status=" + rdbFileStatus.SelectValue;
                }
                if (!String.IsNullOrWhiteSpace(ddlCompany.SelectValue) && ddlCompany.SelectValue != "0")
                {
                    T_Company_BLL compBLL = new T_Company_BLL();
                    T_Company_MDL compMDL = compBLL.GetModel(ConvertEx.ToInt(ddlCompany.SelectValue));
                    if (compMDL != null)
                    {
                        strWhere += " AND DefaultCompanyType=" + compMDL.CompanyType + "";
                    }
                }
                if (!String.IsNullOrWhiteSpace(ddlFileType.SelectValue) && ddlFileType.SelectValue != "0")
                {
                    strWhere += " AND BH like '" + ddlFileType.SelectValue + "%' ";
                }
                if (!String.IsNullOrWhiteSpace(ddlChangeFile.SelectedValue))
                {
                    var changeFile = ddlChangeFile.SelectedValue;
                    if (changeFile == "1")  //有变更
                    {
                        strWhere += " AND ISNULL(version,0)=(SELECT TOP 1 ISNULL(f.RollBackCount,0)from T_WorkFlowDefine f where f.SingleProjectID=" + singleProjectID + " ";
                        strWhere += "AND f.WorkFlowID=" + PublicModel.getWorkFlowIdByWorkFlowCode(SystemSet.EumWorkFlowCode.FILEREG.ToString()) + ") ";
                    }
                    if (changeFile == "0")  //无变更
                    {
                        strWhere += " AND ISNULL(version,0) !=(SELECT TOP 1 ISNULL(f.RollBackCount,0)from T_WorkFlowDefine f where f.SingleProjectID=" + singleProjectID + " ";
                        strWhere += "AND f.WorkFlowID=" + PublicModel.getWorkFlowIdByWorkFlowCode(SystemSet.EumWorkFlowCode.FILEREG.ToString()) + ") ";
                    }
                }

                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"]);
                }
                DataTable dt = fileListBLL.GetListPaging(strWhere, pageSize, pageIndex, out itemCount);

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

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

                rpData.DataSource = dt;
                rpData.DataBind();
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public string getUserInfo(HttpContext context)
        {
            try {
                if (context.Request.Form["username"] == null || context.Request.Form["password"] == null)
                {
                    return("账号或密码为空!");
                }

                T_UsersInfo_BLL userinfobll = new T_UsersInfo_BLL();

                string strPrivateKey = string.Empty;
                using (StreamReader reader = new StreamReader(context.Server.MapPath("/RsaKey/PrivateKey.xml"))) {
                    strPrivateKey = reader.ReadToEnd();
                }

                RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
                rsa.FromXmlString(strPrivateKey);

                byte[] result = rsa.Decrypt(UserLoginGather.HexStringToBytes(context.Request.Form["password"]), false);
                System.Text.ASCIIEncoding enc = new ASCIIEncoding();
                string rsaPwd = enc.GetString(result);

                string loginString = "UPPER(loginname)='" + Common.Common.SqlSafe(context.Request.Form["username"]).ToUpper()
                                     + "' and passwd='" + DESEncrypt.Encrypt(rsaPwd) + "' ";

                List <T_UsersInfo_MDL> userinfomdl = userinfobll.GetModelList(loginString);
                if (userinfomdl.Count > 0)
                {
                    if (userinfomdl[0].IsValid == true)
                    {
                        T_Company_BLL compBLL = new T_Company_BLL();
                        T_Company_MDL compMDL = compBLL.GetModel(userinfomdl[0].CompanyID);
                        if (compMDL != null)
                        {
                            context.Session["IsCompany"]     = compMDL.IsCompany.ToString().ToLower();
                            context.Session["CompanyName"]   = compMDL.CompanyName;
                            context.Session["OLD_AREA_CODE"] = compMDL.AREA_CODE;
                            context.Session["AREA_CODE"]     = "";
                            if (compMDL.IsCompany.ToString().ToLower() == "false")     //只有档案馆,需要区域信息,建设单位等都不要过虑
                            {
                                string myArea_Code    = compMDL.AREA_CODE;
                                string myArea_CodeNew = compMDL.AREA_CODE;
                                for (int i1 = myArea_Code.Length - 1; i1 > 0; i1--)
                                {
                                    if (myArea_Code[i1].ToString() == "0")
                                    {
                                        myArea_CodeNew = myArea_Code.Substring(0, i1);
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                                context.Session["AREA_CODE"] = myArea_CodeNew;
                            }
                            context.Session["CompanyType"] = compMDL.CompanyType;
                        }
                        else
                        {
                            return(SystemSet._RETURN_FAILURE_VALUE + ":单位信息不存在!");
                        }

                        BLL.T_SystemInfo_BLL   systemInfoBLL = new T_SystemInfo_BLL();
                        Model.T_SystemInfo_MDL systemInfoMDL = systemInfoBLL.GetModel(compMDL.CompanyType);
                        if (systemInfoMDL == null)
                        {
                            return(SystemSet._RETURN_FAILURE_VALUE + ":单位类型字典不存在!");
                        }

                        context.Session["CompanyTypeName"] = systemInfoMDL.SystemInfoName;
                        context.Session["CompanyTypeCode"] = systemInfoMDL.SystemInfoCode;
                        context.Session["SystemInfoID"]    = systemInfoMDL.SystemInfoID;
                        context.Session["MyParentID"]      = systemInfoMDL.ParentID;

                        context.Session["UserID"]       = userinfomdl[0].UserID;
                        context.Session["LoginName"]    = userinfomdl[0].LoginName;
                        context.Session["UserName"]     = userinfomdl[0].UserName;
                        context.Session["RoleID"]       = userinfomdl[0].RoleID;
                        context.Session["CompanyID"]    = userinfomdl[0].CompanyID;
                        context.Session["IsLeader"]     = userinfomdl[0].IsLeader;
                        context.Session["SuperAdmin"]   = userinfomdl[0].IsSuperAdmin;
                        context.Session["OwnerFileTmp"] = userinfomdl[0].OwnerFileTmp;         //外协单位用户

                        T_Role_MDL roleMDL = new T_Role_BLL().GetModel(userinfomdl[0].RoleID); //签章用
                        if (roleMDL != null)
                        {
                            context.Session["RoleName"] = roleMDL.RoleName;
                            context.Session["RoleCode"] = roleMDL.RoleCode;
                        }

                        TimeSpan ts      = new TimeSpan(8760, 0, 0);
                        DateTime expired = DateTime.Today.Add(ts);
                        HttpContext.Current.Response.Cookies["LoginName"].Value   = context.Server.UrlEncode(userinfomdl[0].LoginName);
                        HttpContext.Current.Response.Cookies["LoginName"].Expires = expired;

                        //修改最后登录时间
                        userinfomdl[0].LastLoginTime = DateTime.Now;
                        userinfobll.Update(userinfomdl[0]);

                        PublicModel.writeLog(SystemSet.EumLogType.LogIn.ToString(), ";用户登录系统");
                        return(SystemSet._RETURN_SUCCESS_VALUE);
                    }
                    else
                    {
                        return("如果您已经成功注册,请等待确认后再登录!");
                    }
                }
                else
                {
                    return("用户账号或密码错误!");
                }
            } catch (Exception ex) {
                Common.LogUtil.Debug(this, "用户登录BUG", ex);
                return("系统异常,请稍后再试");
            }
        }
Ejemplo n.º 9
0
        //绑定归档目录
        private void BindGridView(int pageIndex)
        {
            T_SingleProject_MDL spMDL = spBLL.GetModel(Common.ConvertEx.ToInt(singleProjectID));

            if (spMDL != null)
            {
                singleProjectNo = spMDL.gcbm;
                projecttype     = spMDL.ProjectType;

                //取当前工程的所有归档目录
                string strWhere = " SingleProjectID=" + singleProjectID;

                //不显示声像节点 //jdk 2014.11.16
                strWhere += " AND BH not like '%S%' ";

                if (PublicModel.isCompany() && !PublicModel.isLeader())   //监理或施工只能看到自己的
                {
                    strWhere += " and operateuserid=" + Common.Session.GetSession("UserID");
                }

                if (ConvertEx.ToBool(SystemSet._ISIGNATUREPDF))
                {
                    if (!string.IsNullOrWhiteSpace(ddliSignaturePdf.SelectedValue))
                    {
                        strWhere += " AND iSignaturePdf=" + ddliSignaturePdf.SelectedValue + "";   //是否需要签章
                    }
                    if (!string.IsNullOrWhiteSpace(ddlSignatureFinishFlag.SelectedValue))          //签章完成状态
                    {
                        string tempStrWhere        = " and iSignaturePdf=1 and IsFolder=0 and (SELECT COUNT(1) from T_FileList_SignatureTmp f1 where f1.FileListID=T_FileList.OldRecID)>0 ";
                        int    signatureFinishFlag = ConvertEx.ToInt(ddlSignatureFinishFlag.SelectedValue); //签章是否完成标记 那已签章完成的记录跟需要签章的记录比对.
                        if (signatureFinishFlag == 1)                                                       //签章完成
                        {
                            tempStrWhere += "and (SELECT COUNT(1) from T_FileList_SignatureLog f0 where f0.FileListID=T_FileList.FileListID and f0.SignatureFinishFlag=1)";
                            tempStrWhere += ">=(SELECT COUNT(1) from T_FileList_SignatureTmp f1 where f1.FileListID=T_FileList.OldRecID) ";
                            strWhere     += tempStrWhere;
                        }
                        else if (signatureFinishFlag == 0)    //签章未完成
                        {
                            tempStrWhere += "and (SELECT COUNT(1) from T_FileList_SignatureLog f0 where f0.FileListID=T_FileList.FileListID and f0.SignatureFinishFlag=1)";
                            tempStrWhere += "<(SELECT COUNT(1) from T_FileList_SignatureTmp f1 where f1.FileListID=T_FileList.OldRecID) ";
                            strWhere     += tempStrWhere;
                        }
                    }
                }

                if (!String.IsNullOrWhiteSpace(txtMyCode.Text.Trim()))
                {
                    strWhere += " AND MyCode LIKE '%" + txtMyCode.Text.Trim() + "%'";
                }
                if (!String.IsNullOrWhiteSpace(txtTitle.Text.Trim()))
                {
                    strWhere += " AND TITLE LIKE '%" + txtTitle.Text.Trim() + "%'";
                }
                if (!String.IsNullOrWhiteSpace(rdbFileStatus.SelectValue) && rdbFileStatus.SelectValue != "0")
                {
                    strWhere += " AND Status=" + rdbFileStatus.SelectValue;
                }
                if (!String.IsNullOrWhiteSpace(ddlCompany.SelectValue) && ddlCompany.SelectValue != "0")
                {
                    T_Company_BLL compBLL = new T_Company_BLL();
                    T_Company_MDL compMDL = compBLL.GetModel(ConvertEx.ToInt(ddlCompany.SelectValue));
                    if (compMDL != null)
                    {
                        strWhere += " AND DefaultCompanyType=" + compMDL.CompanyType + "";
                    }
                }
                if (!String.IsNullOrWhiteSpace(ddlFileType.SelectValue) && ddlFileType.SelectValue != "0")
                {
                    strWhere += " AND BH like '" + ddlFileType.SelectValue + "%' ";
                }

                Session["FileInfostrWhere"] = strWhere;

                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"]);
                }

                DataTable dt = fileListBLL.GetListPaging(strWhere, pageSize, pageIndex, out itemCount);;
                AspNetPager.AlwaysShow = true;
                AspNetPager.PageSize   = pageSize;

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

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