Exemplo n.º 1
0
        public bool CheckUser(string ename)
        {
            BaseDataUserBiz baseDataUserBiz = new BaseDataUserBiz();
            //BaseDataUser baseDataUser = new BaseDataUser();
            //baseDataUser.LoginName = ename;

            IList <BaseDataUser> baseDataUserList = baseDataUserBiz.SelectBaseDataUser(ename, null);

            if (baseDataUserList.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        //获取当前登录者的信息
        public bool GetCurrentUser(ref BaseDataUser currentUser, string pmsId, string loginName)
        {
            try
            {
                currentUser.LoginName = loginName;

                BaseDataUserBiz      baseDataUserBiz  = new BaseDataUserBiz();
                IList <BaseDataUser> baseDataUserList = baseDataUserBiz.SelectBaseDataUser(loginName, null);

                if (baseDataUserList != null || baseDataUserList.Count > 0)
                {
                    currentUser = baseDataUserList[0];
                }
                currentUser = baseDataUserBiz.SetUserOrgRole(currentUser);
                currentUser = baseDataUserBiz.SetUserProjectRole(currentUser, pmsId);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        public void GetReleaseXml(string pmsId, string sdpUrl, out string releaseXml)
        {
            //<CR_ID/>                --HeadSerial                             H
            //<APPLY_SITE/>           --多个site,用单引号分?                  H
            //<PROJECT_NAME/>         --System Name                            H
            //<CREATOR/>              --�有QA传QA,没QA传SD,没SD传SE            D
            //<PROJECT_TYPE/>         --CR/Project/Bug/Services/Study        H
            //<DUE_DATE/>             --YYYYMMDD                               H
            //<PROJECT_STATUS/>       --正常/提前/Delay
            //<PM/>                   --多个人员以单引号分隔,例如: Jack.Huang,Coase.Tseng,Derek.Chang     H
            //<SD/>                   --同上                                   D
            //<SE/>                   --同上                                   D
            //<QA/>                   --同上                                   D
            //<SDP_FILE_NAME/>        --?
            //<SDP_URL/>
            //<CONTACT/>              --�传人名,例如:sammi.yao   (CREATOR  + 分机?)  H


            string roleQA    = "";
            string roleSD    = "";
            string roleSE    = "";
            string contactQA = "";
            string contactSD = "";
            string contactSE = "";
            // string sdp_url = string.Empty;
            StringBuilder xml        = new StringBuilder();
            PmsHeadBiz    pmsHeadBiz = new PmsHeadBiz();


            PmsHead pmsSdpHead = new PmsHead();

            pmsSdpHead.PmsId = pmsId;
            pmsSdpHead.Vid   = "PM";
            IList <PmsHead> pmsSdpHeadList = pmsHeadBiz.SelectPmsHeadOther(pmsSdpHead);

            xml.Append("<RLNS>");
            if (pmsSdpHeadList != null && pmsSdpHeadList.Count > 0)
            {
                string project_status = "";
                string strNowDate     = DateTime.Now.ToString("yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo);
                string due_date       = pmsSdpHeadList[0].DueDate.ToString("yyyyMMdd", System.Globalization.DateTimeFormatInfo.InvariantInfo);
                if (pmsSdpHeadList[0].DueDate == null)
                {
                    project_status = string.Empty;
                }
                else
                {
                    if (Convert.ToInt32(due_date) > Convert.ToInt32(strNowDate))
                    {
                        project_status = "提前";
                    }
                    else if (Convert.ToInt32(due_date) == Convert.ToInt32(strNowDate))
                    {
                        project_status = "正常";
                    }
                    else
                    {
                        project_status = "Delay";
                    }
                }
                //end added

                xml.Append("<CR_ID>").Append(pmsSdpHeadList[0].CrId.Trim()).Append("</CR_ID>");
                xml.Append("<APPLY_SITE>").Append(pmsSdpHeadList[0].Site.Trim()).Append("</APPLY_SITE>");
                xml.Append("<CR_NAME>").Append(pmsSdpHeadList[0].PmsName.Trim()).Append("</CR_NAME>");
                xml.Append("<TYPE>").Append(pmsSdpHeadList[0].Type.Trim()).Append("</TYPE>");
                xml.Append("<DUE_DATE>").Append((pmsSdpHeadList[0].DueDate == null) ? string.Empty : pmsSdpHeadList[0].DueDate.ToString("yyyyMMdd").Trim()).Append("</DUE_DATE>");

                xml.Append("<STATUS>").Append(project_status).Append("</STATUS>");

                xml.Append("<IMPACT>").Append((pmsSdpHeadList[0].Site == null) ? string.Empty : pmsSdpHeadList[0].Site.Trim()).Append("</IMPACT>");
                xml.Append("<PM>").Append(pmsSdpHeadList[0].Pm.Trim()).Append("</PM>");
                xml.Append("<SDP_FILE_NAME>SDP</SDP_FILE_NAME>");
                string systemName = pmsSdpHeadList[0].System.Trim();
                systemName = systemName.Contains("(") ? systemName.Substring(0, systemName.IndexOf("(")) : systemName;
                xml.Append("<SYSTEM>").Append(systemName).Append("</SYSTEM>");
                xml.Append("<OLD_VERSION>").Append((pmsSdpHeadList[0].OldVersion == null) ? string.Empty : pmsSdpHeadList[0].OldVersion.Trim()).Append("</OLD_VERSION>");
                xml.Append("<NEW_VERSION>").Append((pmsSdpHeadList[0].NewVersion == null) ? string.Empty : pmsSdpHeadList[0].NewVersion.Trim()).Append("</NEW_VERSION>");
                xml.Append("<SDP_URL>").Append(sdpUrl).Append("</SDP_URL>");


                #region 获取文档的相关信息
                PmsDocuments pmsDocuments = new PmsDocuments();
                pmsDocuments.PmsId = pmsId;
                IList <PmsDocuments> pmsDocumentsList = new PmsDocumentsBiz().SelectPmsDocuments(pmsDocuments);
                string pesFileName         = string.Empty;
                string pisFileName         = string.Empty;
                string stpFileName         = string.Empty;
                string stcFileName         = string.Empty;
                string rlnFileName         = string.Empty;
                string studyReportFileName = string.Empty;
                string otherFileName       = string.Empty;
                string pesMinFileName      = string.Empty;
                string pisMinFileName      = string.Empty;
                string stpMinFileName      = string.Empty;

                string pesUrl         = string.Empty;
                string pisUrl         = string.Empty;
                string stpUrl         = string.Empty;
                string stcUrl         = string.Empty;
                string rlnUrl         = string.Empty;
                string studyReportUrl = string.Empty;
                string otherUrl       = string.Empty;
                string pesMinUrl      = string.Empty;
                string pisMinUrl      = string.Empty;
                string stpMinUrl      = string.Empty;

                if (pmsDocumentsList != null && pmsDocumentsList.Count > 0)
                {
                    foreach (PmsDocuments d in pmsDocumentsList)
                    {
                        switch (d.DocTypeId)
                        {
                        case (int)PmsCommonEnum.DocumentType.PES:
                            pesFileName = d.FileName;
                            pesUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.PIS:
                            pisFileName = d.FileName;
                            pisUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.STP:
                            stpFileName = d.FileName;
                            stpUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.STC:
                            stcFileName = d.FileName;
                            stcUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.RLN:
                            rlnFileName = d.FileName;
                            rlnUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.Study_Report:
                            studyReportFileName = d.FileName;
                            studyReportUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.Other:
                            otherFileName = d.FileName;
                            otherUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.PES_MIN:
                            pesMinFileName = d.FileName;
                            pesMinUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.PIS_MIN:
                            pisMinFileName = d.FileName;
                            pisMinUrl      = d.Path;
                            break;

                        case (int)PmsCommonEnum.DocumentType.STP_MIN:
                            stpMinFileName = d.FileName;
                            stpMinUrl      = d.Path;
                            break;

                        default:
                            break;
                        }
                    }
                }

                xml.Append("<PES_FILE_NAME>").Append(pesFileName).Append("</PES_FILE_NAME>");
                xml.Append("<PES_URL>").Append(pesUrl).Append("</PES_URL>");

                xml.Append("<PIS_FILE_NAME>").Append(pisFileName).Append("</PIS_FILE_NAME>");
                xml.Append("<PIS_URL>").Append(pisUrl).Append("</PIS_URL>");

                xml.Append("<STP_FILE_NAME>").Append(stpFileName).Append("</STP_FILE_NAME>");
                xml.Append("<STP_URL>").Append(stpUrl).Append("</STP_URL>");

                xml.Append("<STC_FILE_NAME>").Append(stcFileName).Append("</STC_FILE_NAME>");
                xml.Append("<STC_URL>").Append(stcUrl).Append("</STC_URL>");

                xml.Append("<RLN_FILE_NAME>").Append(rlnFileName).Append("</RLN_FILE_NAME>");
                xml.Append("<RLN_URL>").Append(rlnUrl).Append("</RLN_URL>");

                xml.Append("<StudyReport_FILE_NAME>").Append(studyReportFileName).Append("</StudyReport_FILE_NAME>");
                xml.Append("<StudyReport_URL>").Append(studyReportUrl).Append("</StudyReport_URL>");

                xml.Append("<Other_FILE_NAME>").Append(otherFileName).Append("</Other_FILE_NAME>");
                xml.Append("<Other_URL>").Append(otherUrl).Append("</Other_URL>");

                xml.Append("<PES_MIN_FILE_NAME>").Append(pesMinFileName).Append("</PES_MIN_FILE_NAME>");
                xml.Append("<PES_MIN_URL>").Append(pesMinUrl).Append("</PES_MIN_URL>");

                xml.Append("<PIS_MIN_FILE_NAME>").Append(pisMinFileName).Append("</PIS_MIN_FILE_NAME>");
                xml.Append("<PIS_MIN_URL>").Append(pisMinUrl).Append("</PIS_MIN_URL>");

                xml.Append("<STP_MIN_FILE_NAME>").Append(stpMinFileName).Append("</STP_MIN_FILE_NAME>");
                xml.Append("<STP_MIN_URL>").Append(stpMinUrl).Append("</STP_MIN_URL>");

                #endregion


                BaseDataUserBiz baseDataUserBiz = new BaseDataUserBiz();
                //  BaseDataUser baseDataUser = new BaseDataUser();
                if (!string.IsNullOrEmpty(pmsSdpHeadList[0].Qa))
                {
                    roleQA = string.Concat(roleQA, ",", pmsSdpHeadList[0].Qa);
                    string[] qas = roleQA.Split(';');
                    foreach (string str in qas)
                    {
                        if (string.IsNullOrEmpty(str))
                        {
                            string ext = baseDataUserBiz.SelectBaseDataUser(str.Trim(), null)[0].Extention;
                            contactQA = string.Concat(contactQA, ",", str, " ", ext);
                        }
                    }
                }
                if (!string.IsNullOrEmpty(pmsSdpHeadList[0].Sd))
                {
                    roleSD = string.Concat(roleSD, ",", pmsSdpHeadList[0].Sd);
                    string[] sds = roleSD.Split(';');
                    foreach (string str in sds)
                    {
                        if (string.IsNullOrEmpty(str))
                        {
                            string ext = baseDataUserBiz.SelectBaseDataUser(str.Trim(), null)[0].Extention;
                            contactSD = string.Concat(contactSD, ",", str, " ", ext);
                        }
                    }
                }
                if (!string.IsNullOrEmpty(pmsSdpHeadList[0].Se))
                {
                    roleSE = string.Concat(roleSE, ",", pmsSdpHeadList[0].Se);
                    string[] ses = roleSE.Split(';');
                    foreach (string str in ses)
                    {
                        if (string.IsNullOrEmpty(str))
                        {
                            string ext = baseDataUserBiz.SelectBaseDataUser(str.Trim(), null)[0].Extention;
                            contactSE = string.Concat(contactSE, ",", str, " ", ext);
                        }
                    }
                }

                xml.Append("<SD>").Append((roleSD != "") ? roleSD.Substring(1) : string.Empty).Append("</SD>");
                xml.Append("<SE>").Append((roleSE != "") ? roleSE.Substring(1) : string.Empty).Append("</SE>");
                xml.Append("<QA>").Append((roleQA != "") ? roleQA.Substring(1) : string.Empty).Append("</QA>");
                if (roleSD != "" || roleSE != "" || roleQA != "")
                {
                    xml.Append("<CREATOR>").Append((roleQA.Length > 1) ? roleQA.Substring(1) : (roleSD.Length > 1) ? roleSD.Substring(1) : roleSE.Substring(1)).Append("</CREATOR>");
                }
                else
                {
                    xml.Append("<CREATOR>").Append(string.Empty).Append("</CREATOR>");
                }
            }
            xml.Append("</RLNS>");
            m_Logger.Error(xml);
            releaseXml = xml.ToString();
        }