コード例 #1
0
        public bool UpdateParentFlag(string serial)
        {
            TmpSdpImportdetail tmpSdpImportdetailForUpdate = new TmpSdpImportdetail();

            tmpSdpImportdetailForUpdate.Serial = int.Parse(serial.Trim());
            TmpSdpImportdetailBiz tmpSdpImportdetailBiz = new TmpSdpImportdetailBiz();

            if (!tmpSdpImportdetailBiz.UpdateTmpSdpDetailFlag(tmpSdpImportdetailForUpdate))
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
        public void ProcessRequest(HttpContext context)
        {
            PageParameterManager pageParameterManager = new PageParameterManager(context);

            var tmpSdpImportdetail = new TmpSdpImportdetail
            {
                Pmsid = pageParameterManager.GetString("Pmsid"),

                //tmpSdpImportdetail.Pmsid = pageParameterManager.GetRequiredGuid("Pmsid").ToString(),
                //Subject_Category = pageParameterManager.GetRequiredString("subjectCategory"),
                //Subject_Id = pageParameterManager.GetRequiredGuid("subjectId"),
                //Resource_Org_Id = pageParameterManager.GetRequiredGuid("resourceOrgId"),
            };

            TmpSdpImportdetailBiz tmpSdpImportdetailBiz = new TmpSdpImportdetailBiz();
            var listTmpSdpImportdetail = tmpSdpImportdetailBiz.GetTmpSdpDetail(tmpSdpImportdetail);
            var serializer             = EasyuiTreegridHelp.Serializer <TmpSdpImportdetail>(listTmpSdpImportdetail, null, "Parentno", string.Empty);


            context.Response.ContentType = "text/plain";
            context.Response.Write(serializer);
        }
コード例 #3
0
        public bool UpdateSdpDetailBySerial(string serials, string sdpDetailSerials)
        {
            string[] serialArray          = serials.Split(';');
            string[] sdpDetailSerialArray = sdpDetailSerials.Split(';');

            for (int i = 0; i < serialArray.Length; i++)
            //foreach (string serial in serialArray)
            {
                TmpSdpImportdetail tmpSdpImportdetail = new TmpSdpImportdetail();
                tmpSdpImportdetail.Serial = int.Parse(serialArray[i].Trim());
                TmpSdpImportdetailBiz tmpSdpImportdetailBiz = new TmpSdpImportdetailBiz();
                var listTmpSdpImportdetail = tmpSdpImportdetailBiz.GetTmpSdpDetail(tmpSdpImportdetail);
                if (listTmpSdpImportdetail == null || listTmpSdpImportdetail.Count == 0)
                {
                    return(false);
                }
                else
                {
                    tmpSdpImportdetail = listTmpSdpImportdetail[0];
                }


                //更新sdpDetail表
                SdpDetailBiz sdpDetailBiz = new SdpDetailBiz();
                SdpDetail    sdpDetail    = new SdpDetail();
                DateTime     dateTime     = PmsSysBiz.GetDBDateTime();


                //根据pmsid和serial 定位要跟新的任务
                sdpDetail.Pmsid  = tmpSdpImportdetail.Pmsid;
                sdpDetail.Serial = int.Parse(sdpDetailSerialArray[i]);

                //获取已存在任务在 tmp_sdp_importdetail表中不存在的栏位
                SdpDetail SdpDetailResult = new SdpDetailBiz().SelectSdpDetail(sdpDetail)[0];
                sdpDetail = SdpDetailResult;

                sdpDetail.TaskName        = tmpSdpImportdetail.TaskName;
                sdpDetail.OperationType   = tmpSdpImportdetail.OperationType;
                sdpDetail.TaskType        = tmpSdpImportdetail.TaskType;
                sdpDetail.FunctionType    = tmpSdpImportdetail.FunctionType;
                sdpDetail.ProgramLanguage = tmpSdpImportdetail.ProgramLanguage;
                sdpDetail.TaskComplexity  = tmpSdpImportdetail.TaskComplexity;

                //根据条件取,取值为空->refCost=planCost
                PmsSdpRefcost sdpRefcost = new PmsSdpRefcost();
                sdpRefcost.OperationType   = sdpDetail.OperationType;
                sdpRefcost.TaskComplexity  = sdpDetail.TaskComplexity;
                sdpRefcost.Tasktype        = sdpDetail.TaskType;
                sdpRefcost.Functiontype    = sdpDetail.FunctionType;
                sdpRefcost.Programlanguage = sdpDetail.ProgramLanguage;
                IList <PmsSdpRefcost> sdpRefcostlList = new PmsSdpRefcostBiz().SelectPmsSdpRefcost(sdpRefcost);
                if (sdpRefcostlList == null || sdpRefcostlList.Count == 0)
                {
                    sdpDetail.Refcost = tmpSdpImportdetail.Plancost;
                }
                else
                {
                    sdpDetail.Refcost = sdpRefcostlList[0].Refcost;
                }
                sdpDetail.Plancost     = tmpSdpImportdetail.Plancost;
                sdpDetail.Auditor      = new BaseDataUserBiz().SelectLeaderByLoginName(LoginName);
                sdpDetail.Planstartday = tmpSdpImportdetail.Planstartday;
                sdpDetail.Planendday   = tmpSdpImportdetail.Planendday;
                sdpDetail.Resource     = tmpSdpImportdetail.Resource;
                sdpDetail.Role         = tmpSdpImportdetail.Role;
                sdpDetail.Maintaindate = dateTime;
                sdpDetail.Maintainuser = LoginName;

                if (!sdpDetailBiz.UpdateSdpDetail(sdpDetail))
                {
                    return(false);
                }
                //更新临时表Falg栏位为“Y”
                TmpSdpImportdetail tmpSdpImportdetailForUpdate = new TmpSdpImportdetail();
                tmpSdpImportdetailForUpdate.Serial = int.Parse(serialArray[i].Trim());
                if (!tmpSdpImportdetailBiz.UpdateTmpSdpDetailFlag(tmpSdpImportdetailForUpdate))
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #4
0
        public bool ImportSdpDetailBySerial(string serials)
        {
            string[] serialArray = serials.Split(';');
            foreach (string serial in serialArray)
            {
                TmpSdpImportdetail tmpSdpImportdetail = new TmpSdpImportdetail();
                tmpSdpImportdetail.Serial = int.Parse(serial.Trim());
                TmpSdpImportdetailBiz tmpSdpImportdetailBiz = new TmpSdpImportdetailBiz();
                var listTmpSdpImportdetail = tmpSdpImportdetailBiz.GetTmpSdpDetail(tmpSdpImportdetail);
                if (listTmpSdpImportdetail == null || listTmpSdpImportdetail.Count == 0)
                {
                    return(false);
                }
                else
                {
                    tmpSdpImportdetail = listTmpSdpImportdetail[0];
                }


                //插入sdpDetail表
                SdpDetailBiz sdpDetailBiz = new SdpDetailBiz();
                SdpDetail    sdpDetail    = new SdpDetail();
                DateTime     dateTime     = PmsSysBiz.GetDBDateTime();

                sdpDetail.Pmsid = tmpSdpImportdetail.Pmsid;
                sdpDetail.Phase = tmpSdpImportdetail.Phase;

                sdpDetail.TaskName        = tmpSdpImportdetail.TaskName;
                sdpDetail.OperationType   = tmpSdpImportdetail.OperationType;
                sdpDetail.TaskType        = tmpSdpImportdetail.TaskType;
                sdpDetail.FunctionType    = tmpSdpImportdetail.FunctionType;
                sdpDetail.ProgramLanguage = tmpSdpImportdetail.ProgramLanguage;
                sdpDetail.TaskComplexity  = tmpSdpImportdetail.TaskComplexity;

                //根据条件取,为空就为planCost
                PmsSdpRefcost sdpRefcost = new PmsSdpRefcost();
                sdpRefcost.OperationType   = sdpDetail.OperationType;
                sdpRefcost.TaskComplexity  = sdpDetail.TaskComplexity;
                sdpRefcost.Tasktype        = sdpDetail.TaskType;
                sdpRefcost.Functiontype    = sdpDetail.FunctionType;
                sdpRefcost.Programlanguage = sdpDetail.ProgramLanguage;
                IList <PmsSdpRefcost> sdpRefcostlList = new PmsSdpRefcostBiz().SelectPmsSdpRefcost(sdpRefcost);
                if (sdpRefcostlList == null || sdpRefcostlList.Count == 0)
                {
                    sdpDetail.Refcost = tmpSdpImportdetail.Plancost;
                }
                else
                {
                    sdpDetail.Refcost = sdpRefcostlList[0].Refcost;
                }


                sdpDetail.Plancost     = tmpSdpImportdetail.Plancost;
                sdpDetail.Auditor      = new BaseDataUserBiz().SelectLeaderByLoginName(LoginName);
                sdpDetail.Planstartday = tmpSdpImportdetail.Planstartday;
                sdpDetail.Planendday   = tmpSdpImportdetail.Planendday;
                sdpDetail.Resource     = tmpSdpImportdetail.Resource;
                sdpDetail.Role         = tmpSdpImportdetail.Role;
                sdpDetail.AuditStatus  = 1;
                sdpDetail.TaskStatus   = 1;
                sdpDetail.Taskno       = 1;
                sdpDetail.Iseditable   = "Y";
                sdpDetail.Deleteflag   = "N";
                sdpDetail.Createdate   = dateTime;
                sdpDetail.Createuser   = LoginName;
                sdpDetail.Maintaindate = dateTime;
                sdpDetail.Maintainuser = LoginName;

                if (new SdpDetailBiz().InsertSdpDetail(sdpDetail) < 0)
                {
                    return(false);
                }
                //更新临时表Falg栏位为“Y”
                TmpSdpImportdetail tmpSdpImportdetailForUpdate = new TmpSdpImportdetail();
                tmpSdpImportdetailForUpdate.Serial = int.Parse(serial.Trim());
                if (!tmpSdpImportdetailBiz.UpdateTmpSdpDetailFlag(tmpSdpImportdetailForUpdate))
                {
                    return(false);
                }
            }
            return(true);
        }