Esempio n. 1
0
        private void InitPage()
        {
            try
            {
                LoginName = WSC.GlobalDefinition.Cookie_LoginUser.Replace(" ", ".");



                ButtonSaveTop.Attributes.Add("onclick", "return CheckBeforeSave()");
                ButtonSaveUnder.Attributes.Add("onclick", "return CheckBeforeSave()");
                ButtonCancelTop.OnClientClick   = "window.close()";
                ButtonCancelUnder.OnClientClick = "window.close()";

                //取得project,module
                PmsHead pmsHead = new PmsHead();
                pmsHead.Vid      = "PM";
                pmsHead.UserName = LoginName;
                pmsHead.CrId     = CrID;

                string        minID         = string.Empty;
                PmsMinHeadBiz pmsMinHeadBiz = new PmsMinHeadBiz();
                pmsMinHeadBiz.GetMinId(out minID);
                MinID = minID;  // 保存到ViewState,发mail时使用


                PmsHeadBiz      pmsHeadBiz  = new PmsHeadBiz();
                IList <PmsHead> pmsHeadList = pmsHeadBiz.SelectPmsHeadOther(pmsHead);
                string          project     = pmsHeadList[0].BugFreeProject;
                string          module      = pmsHeadList[0].BugFreeModule;


                string IssueCreateUrl = ConfigurationManager.AppSettings["IssueCreateUrl"];
                string paraMeter      = "&PmsID=" + Server.UrlEncode(GetBase64Encode(PmsID))
                                        + "&UserName="******".", " ")))
                                        + "&CrID=" + Server.UrlEncode(GetBase64Encode(CrID))
                                        + "&BugFreeProject=" + Server.UrlEncode(GetBase64Encode(project))
                                        + "&BugFreeModule=" + Server.UrlEncode(GetBase64Encode(module))
                                        + "&MNID=" + Server.UrlEncode(GetBase64Encode(MinID));

                ButtonCreateIssue.OnClientClick = "javascript:window.open('" + IssueCreateUrl + paraMeter + "');";

                BindDropDown();
                InitTextBox();

                GridViewBind(null);
                GridViewIssueBind();
            }
            catch (Exception ex)
            {
                Msgbox("Init Page Failed !");
            }
        }
Esempio n. 2
0
        protected void gridViewMain_RowCreated(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string crId    = string.Empty;
                string project = string.Empty;
                string module  = string.Empty;

                if (e.Row.DataItem != null)
                {
                    crId    = DataBinder.Eval(e.Row.DataItem, "crid").ToString();
                    project = DataBinder.Eval(e.Row.DataItem, "BugFreeProject").ToString();
                    module  = DataBinder.Eval(e.Row.DataItem, "BugFreeModule").ToString();
                    //bugfree系统获取url参数时,需要进行解码Server.UrlDecode(Request.QueryString["BugFreeProject"].ToString());
                }

                ImageButton imageButtonDetail = (ImageButton)e.Row.FindControl("imageButtonDetail");
                imageButtonDetail.OnClientClick = "javascript:window.location='" + "ProjectsInformation.aspx?PmsID=" + gridViewMain.DataKeys[e.Row.RowIndex][0] + "'; ";
                //imageButtonDetail.OnClientClick = "javascript:window.open('" + ConfigurationSettings.AppSettings["PMSExternalSystemViewUrl"] + "?Action=VIEW&PmsID=" + gridViewMain.DataKeys[e.Row.RowIndex][0] + "'); "; // changed window.location to window.open by Ename Wang 20111115

                ImageButton imageButtonBugfree = (ImageButton)e.Row.FindControl("imageButtonBugfree");

                imageButtonBugfree.OnClientClick = "javascript:window.open('" + BugCreateUrl + "&PmsID=" + Server.UrlEncode(GetBase64Encode(gridViewMain.DataKeys[e.Row.RowIndex][0].ToString())) + "&UserName="******".", " "))) + "&CrID=" + Server.UrlEncode(GetBase64Encode(crId)) + "&BugFreeProject=" + Server.UrlEncode(GetBase64Encode(project)) + "&BugFreeModule=" + Server.UrlEncode(GetBase64Encode(module)) + "');";
                //ImageButton imageButtonBugfreeInquire = (ImageButton)e.Row.FindControl("imageButtonBugfree");
                //imageButtonBugfreeInquire.OnClientClick = "javascript:window.location='" + "BugInquiry.aspx?PmsID=" + gridViewMain.DataKeys[e.Row.RowIndex][0] + "&CrID=" + crId + "';return false;";
            }
        }
Esempio n. 3
0
        //Abel 注释掉 on 2014-01-22
        //private bool DevelopTestCheck(string type, out string message)
        //{
        //    message = "";
        //    try
        //    {
        //        IList<string> phaseList = m_ProjectProgressBiz.SelectSdpDetailTemplatePhase(type);

        //        foreach (string phase in phaseList)
        //        {
        //            int intPhase = int.Parse(phase.Trim());
        //            if (intPhase == (int)PmsCommonEnum.EnumSdpPhase.Design)
        //            {
        //                string designCompletedPercent = PageProjectsInformation.DesignCompletedPercent;
        //                if (designCompletedPercent != "100.0%")
        //                {
        //                    message = "Please finish the design phase of SDP!";
        //                    return false;
        //                }
        //            }

        //            if (intPhase == (int)PmsCommonEnum.EnumSdpPhase.Development)
        //            {
        //                string developmentCompletedPercent = PageProjectsInformation.DevelopmentCompletedPercent;
        //                if (developmentCompletedPercent != "100.0%")
        //                {
        //                    message = "Please finish the development phase of SDP!";
        //                    return false;
        //                }
        //            }

        //            if (intPhase == (int)PmsCommonEnum.EnumSdpPhase.Test && type != PmsCommonEnum.ProjectTypeFlowId.Service.GetDescription())
        //            {

        //                string testCompletedPercent = PageProjectsInformation.TestCompletedPercent;
        //                if (testCompletedPercent != "100.0%")
        //                {
        //                    message = "Please finish the test phase of SDP!";
        //                    return false;
        //                }
        //            }

        //        }

        //        return true;
        //    }
        //    catch (Exception)
        //    {
        //        return false;
        //    }
        //}
        #endregion

        protected void ImageButtonStage_Click(object sender, ImageClickEventArgs e)
        {
            #region 获取信息pmsHead
            //从数据库中获取最新数据
            PmsHead         pmsHead     = null;
            PmsHeadBiz      pmsHeadBiz  = new PmsHeadBiz();
            IList <PmsHead> pmsHeadList = pmsHeadBiz.SelectPmsHead(PmsID, null);
            if (pmsHeadList != null && pmsHeadList.Count > 0)
            {
                pmsHead = pmsHeadList[0];
            }
            else
            {
                Msgbox("无相关资料!");
                return;
            }
            #endregion

            #region 检查是否符合推进条件
            string message;
            if (!CheckPromote(pmsHead, out message))
            {
                Msgbox(message);
                return;
            }
            #endregion

            #region 更新数据库(推进成功)

            //获取当前的type类型对应的pmsFlow
            int         intPending    = (int)PmsCommonEnum.ProjectStage.Pending;
            int         intHardClosed = (int)PmsCommonEnum.ProjectStage.HardClosed;
            int         intCancelled  = (int)PmsCommonEnum.ProjectStage.Cancelled;
            int         intReactive   = (int)PmsCommonEnum.ProjectStage.Reactive;
            IList <int> stages        = ProjectTypeStageList.Select(t => t)
                                        .Where(p => (p.Typeid == ProjectType &&
                                                     p.Stageid != intPending &&
                                                     p.Stageid != intHardClosed &&
                                                     p.Stageid != intCancelled &&
                                                     p.Stageid != intReactive))
                                        .OrderBy(m => m.Order)
                                        .Select(t => t.Stageid)
                                        .ToList();

            int oldStage = Stage;
            int newStage = 0;

            for (int i = 0; i < stages.Count; i++)
            {
                if (oldStage == stages[i])
                {
                    newStage = stages[i + 1];
                }
            }

            string strAction = Enum.Parse(typeof(PmsCommonEnum.ProjectStage), oldStage.ToString()).GetDescription();

            #region  SDP confirm

            //Pm or Sd must confirm the SDP  Change only Sd confirm
            //if (IsPm(pmsHead.Pm, CurrentUser.LoginName) || IsSd(pmsHead.Sd, CurrentUser.LoginName))
            if (IsSd(pmsHead.Sd, CurrentUser.LoginName))
            {
                switch (pmsHead.Type)
                {
                case "CR":
                case "Study":
                case "Project":
                    if (strAction == PmsCommonEnum.ProjectStage.PIS_STP.GetDescription())
                    {
                        if (pmsHead.SDPConfirmDate.ToString("yyyy") == "0000" || pmsHead.SDPConfirmDate.ToString("yyyy") == "0001" ||
                            pmsHead.SDPConfirmDate.ToString("yyyy") == "1900")
                        {
                            Msgbox("Please Click SDP Confirm First");
                            return;
                        }
                    }
                    break;

                case "Small CR":

                    if (strAction == PmsCommonEnum.ProjectStage.Develop_Test.GetDescription())
                    {
                        if (pmsHead.SDPConfirmDate.ToString("yyyy") == "0000" || pmsHead.SDPConfirmDate.ToString("yyyy") == "0001" ||
                            pmsHead.SDPConfirmDate.ToString("yyyy") == "1900")
                        {
                            Msgbox("Please Click SDP Confirm First");
                            return;
                        }
                    }
                    break;

                default:
                    break;
                }
            }
            #endregion

            bool blResult = new BasicInformationDetailBiz().UpdateStages(PmsID, LoginName, oldStage, newStage, strAction);

            //从waitingclose到Close,需要更新Head页签closeday事件
            if (oldStage == (int)PmsCommonEnum.ProjectStage.WaitingClosed)
            {
                DateTime closeDate = PmsSysBiz.GetDBDateTime();

                pmsHeadBiz.UpdatePmsHeadCloseDate(PmsID, LoginName, closeDate);

                //修改BasicInformationDetail页面和Service页面上的close时间;
                PageProjectsInformation.CloseDate           = m_PmsCommonBiz.FormatDateTime(closeDate.ToString("yyyy-MM-dd").Trim());
                PageProjectsInformation.CloseDateForService = m_PmsCommonBiz.FormatDateTime(closeDate.ToString("yyyy-MM-dd").Trim());
            }


            if (!blResult)
            {
                Msgbox("更新stage数据失败!");
            }

            #endregion

            #region 重绘控件
            //如果推进到release 则点亮BasicInformationDetail.ascx
            if (newStage == (int)PmsCommonEnum.ProjectStage.Release)
            {
                PageProjectsInformation.SetReleaseButtonEnable();
            }

            Stage = newStage;
            InitPmsFlow(Stage, ProjectType);
            #endregion

            #region 发送相关的mail
            LoginName.Replace(".", " ");
            pmsHead.UserName = LoginName;
            new MailBiz().SendPromoteMail(pmsHead, newStage);
            #endregion
        }
Esempio n. 4
0
        protected void ButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                //get creator,createDate,pmsID,crID
                string   creator = WSC.GlobalDefinition.Cookie_LoginUser.Replace(" ", ".");
                DateTime createDate;
                string   pmsID = string.Empty;
                string   crId  = string.Empty;
                m_PmsCRCreatBiz.GetNewPmsIdTempCrId(out createDate, out pmsID, out crId);

                //get pmsHead,pmsflow,sdpDetail,getPmsChangeHistory,getPmsItarmMapping,getPmsFlow,itarmCrList
                PmsHead              pmsHead          = getPmsHead(creator, createDate, pmsID);
                SdpDetail            sdpDetail        = getSdpDetail(pmsID);
                PmsChangeHistory     pmsChangeHistory = getPmsChangeHistory(creator, createDate, pmsID);
                PmsItarmMapping      pmsItarmMapping  = getPmsItarmMapping(creator, createDate, pmsID, crId);
                PmsFlow              pmsFlow          = getPmsFlow(creator, createDate, pmsID);
                ItarmCrList          itarmCrList      = getItarmCrList(creator, createDate, crId);
                IList <PmsDocuments> pmsDocuments     = getPmsDocuments(creator, createDate, pmsID, crId);
                if (pmsHead == null)
                {
                    Msgbox("Save failed");
                    return;
                }
                //Insert
                PmsHeadBiz pmsInsert = new PmsHeadBiz();
                string     errorInfo;
                int        insertResult = pmsInsert.InsertPmsHeadAndDoc(pmsHead, sdpDetail, pmsChangeHistory, pmsItarmMapping, pmsFlow, itarmCrList, pmsDocuments, out errorInfo);

                if (insertResult == 0)
                {
                    Msgbox(errorInfo);
                }
                else
                {
                    //将TempFile文件夹里的文件移动到UploadFile下以CRNO命名的文件夹里并删除Temp里的文件。
                    MoveUploadFileDeleteTempFile(crId);
                    LoginName.Replace(".", " ");
                    pmsHead.UserName = LoginName;
                    new MailBiz().SendCreateMail(pmsHead);

                    // 更新Stage 自动把这个Cr推进到AssginMember
                    int    oldStage  = (int)PmsCommonEnum.ProjectStage.PES;
                    int    newStage  = (int)PmsCommonEnum.ProjectStage.AssignMember;
                    string strAction = Enum.Parse(typeof(PmsCommonEnum.ProjectStage), oldStage.ToString()).GetDescription();
                    bool   blResult  = new BasicInformationDetailBiz().UpdateStages(pmsID, LoginName, oldStage, newStage, strAction);
                    if (!blResult)
                    {
                        Msgbox("更新stage数据失败!");
                        return;
                    }
                    new MailBiz().SendPromoteMail(pmsHead, newStage);
                    Msgbox("Create Successful!");
                    PageRegisterStartupScript("window.close();");
                }
            }
            catch (Exception exception)
            {
                throw new Exception(exception.ToString());
            }
        }