Exemplo n.º 1
0
        protected string HandlerAddSimulationRequest()
        {
            System.Text.StringBuilder sbResult = new System.Text.StringBuilder();
            try
            {
                string strId = string.Empty;
                int Id = default(int);

                if (CY.Utility.Common.RequestUtility.IsGet)
                {
                    strId = CY.Utility.Common.RequestUtility.GetQueryString("Id");
                }
                else if (CY.Utility.Common.RequestUtility.IsPost)
                {
                    strId = CY.Utility.Common.RequestUtility.GetFormString("Id");
                }

                if (string.IsNullOrEmpty(strId) || !CY.Utility.Common.ParseUtility.TryParseInt32(strId, out Id))
                {
                    return sbResult.Append("{success:false,action:'none',status:'none',msg:'参数错误!'}").ToString();
                }

                CY.CSTS.Core.Business.StimulationType type = new CY.CSTS.Core.Business.StimulationType();

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {

            }
            return string.Empty;
        }
Exemplo n.º 2
0
        protected void bindPage()
        {
            IList<CY.CSTS.Core.Business.StimulationType> typeList = CY.CSTS.Core.Business.StimulationType.SelectStimulationTypesByStimulationId(checkforcenter.Id);
            CY.CSTS.Core.Business.StimulationType typeSub = new CY.CSTS.Core.Business.StimulationType();
            CY.CSTS.Core.Business.StimulationType typecrew = new CY.CSTS.Core.Business.StimulationType();
            CY.CSTS.Core.Business.StimulationType typecenter = new CY.CSTS.Core.Business.StimulationType();
            for (int i = 0; i < typeList.Count; i++)
            {
                if (typeList[i].StimulatedType == 1)//机组
                {
                    typecrew = typeList[i];
                }
                else if (typeList[i].StimulatedType == 2)
                {
                    typecenter = typeList[i];
                }
                else if (typeList[i].StimulatedType == 3)
                {
                    typeSub = typeList[i];
                }
            }

            if (typecrew.Id != null)
            {
                IList<CY.CSTS.Core.Business.StimulationApplicationForCrew> crewList = CY.CSTS.Core.Business.StimulationApplicationForCrew.GetStimulationApplicationBytypeId(typecrew.Id);
                gvcrewlist.DataSource = crewList;
                gvcrewlist.DataBind();
            }

            if (typecenter.Id != null)
            {
                IList<CY.CSTS.Core.Business.StimulationApplicationForCenter> centerList = CY.CSTS.Core.Business.StimulationApplicationForCenter.GetAllStimulationApplicationForCenter();
                if (centerList != null && centerList.Count != 0)
                {
                    for (int i = centerList.Count - 1; i >= 0; i--)
                    {
                        CY.CSTS.Core.Business.StimulationAppliction app = CY.CSTS.Core.Business.StimulationAppliction.Load(centerList[i].Id);
                        if (app != null && app.StimulationAndTypeId != typecenter.Id)
                        {
                            centerList.RemoveAt(i);
                        }
                    }
                    gvCenterList.DataSource = centerList;
                    gvCenterList.DataBind();
                }
            }

            if (typeSub.Id != null)
            {
                IList<CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit> subList = CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit.GetStimulationApplicationForSubCenterAndCollaborateUnitBytypeId(typeSub.Id);
                gvSubCentlist.DataSource = subList;
                gvSubCentlist.DataBind();
            }
        }
Exemplo n.º 3
0
        protected void binddetail()
        {
            string id = string.Empty;
            string order = string.Empty;
            stimulation = CY.CSTS.Core.Business.StimulationCheck.getNew();
            if (stimulation != null)
            {
                IDofCheck.Text = stimulation.Id.ToString();
                stimulationtypelist = CY.CSTS.Core.Business.StimulationType.SelectStimulationTypesByStimulationId(stimulation.Id);
            }

            for (int i = 0; i < stimulationtypelist.Count; i++)
            {
                if (stimulationtypelist.ElementAt(i).StimulatedType == 1)
                {
                    crewtype = stimulationtypelist.ElementAt(i);
                    string sqlwhere = "StimulationAndTypeId = '" + crewtype.Id + "'";
                    applicationCrew = CY.CSTS.Core.Business.StimulationAppliction.GetStimuAppListWhere(sqlwhere, "StimulationApplicationForCrew");
                }
                else if (stimulationtypelist.ElementAt(i).StimulatedType == 2)
                {
                    centertype = stimulationtypelist.ElementAt(i);
                    string sqlwhere = "StimulationAndTypeId = '" + centertype.Id + "'";
                    applicationCenter = CY.CSTS.Core.Business.StimulationAppliction.GetStimuAppListWhere(sqlwhere, "StimulationApplicationForCenter");
                }
                else if (stimulationtypelist.ElementAt(i).StimulatedType == 3 || stimulationtypelist.ElementAt(i).StimulatedType == 4)
                {
                    unitandsubtype = stimulationtypelist.ElementAt(i);
                    string sqlwhere = "StimulationAndTypeId = '" + unitandsubtype.Id + "'";
                    applicationSubAndUnit = CY.CSTS.Core.Business.StimulationAppliction.GetStimuAppListWhere(sqlwhere, "StimulationApplicationForSubCenterAndCollaborateUnit");
                }
            }
            TotalDataCenter = new List<CY.CSTS.Core.Business.StimulationApplicationForCenter>();
            TotalDataCrew = new List<CY.CSTS.Core.Business.StimulationApplicationForCrew>();
            TotalDataSubCenter = new List<CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit>();
            TotalDataCoor = new List<CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit>();
            if (applicationCenter != null)
            {
                for (int j = 0; j < applicationCenter.Count; j++)
                {
                    CY.CSTS.Core.Business.StimulationApplicationForCenter toolcenter = CY.CSTS.Core.Business.StimulationApplicationForCenter.Load(applicationCenter[j].Id);
                    if (toolcenter != null && toolcenter.State != 1)
                    {
                        TotalDataCenter.Add(toolcenter);
                    }
                }
            }
            if (applicationCrew != null)
            {
                for (int j = 0; j < applicationCrew.Count; j++)
                {
                    CY.CSTS.Core.Business.StimulationApplicationForCrew toolcrew = CY.CSTS.Core.Business.StimulationApplicationForCrew.Load(applicationCrew[j].Id);
                    if (toolcrew != null)
                    {
                        TotalDataCrew.Add(toolcrew);
                    }
                }
            }
            if (applicationSubAndUnit != null)
            {
                for (int j = 0; j < applicationSubAndUnit.Count; j++)
                {
                    CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit toolsubcenter = CY.CSTS.Core.Business.StimulationApplicationForSubCenterAndCollaborateUnit.Load(applicationSubAndUnit[j].Id);
                    if (toolsubcenter != null)
                    {
                        CY.CSTS.Core.Business.UnitInfo unit = CY.CSTS.Core.Business.UnitInfo.Load(toolsubcenter.UintId);
                        if (unit != null)
                        {
                            if (unit.IsCooperantUnit == 1)
                            {
                                TotalDataCoor.Add(toolsubcenter);
                            }
                            else
                            {
                                TotalDataSubCenter.Add(toolsubcenter);
                            }
                        }
                    }
                }
            }
            bindapplications();
        }
Exemplo n.º 4
0
 private void AddStimulationType(System.Guid id, DateTime applyDate, DateTime firstDate,
     DateTime secondDate, DateTime examineDate, int status, List<int> ids)
 {
     if (id == System.Guid.Empty)
     {
         return;
     }
     List<CY.CSTS.Core.Business.ObjectStimulatedType> OriginalTypes = CY.CSTS.Core.Business.ObjectStimulatedType.GetAllObjectStimulatedType() as List<CY.CSTS.Core.Business.ObjectStimulatedType>;
     if (OriginalTypes != null)
     {
         CY.CSTS.Core.Business.StimulationType stimulationType = null;
         foreach (CY.CSTS.Core.Business.ObjectStimulatedType type in OriginalTypes)
         {
             if (ids.Exists(item => item == type.Id))
             {
                 stimulationType = new CY.CSTS.Core.Business.StimulationType()
                 {
                     State = CY.Utility.Common.CodeInterface.PhaseState.Start.State,
                     StimulationId = id,
                     StimulatedType = type.Id,
                     ApplyingEndDate = applyDate,
                     ExpertCheckEndDate = examineDate,
                     FirstChenEndDate = firstDate,
                     SecondCheckEndDate = secondDate
                 };
                 if (status == 1)
                 {
                     stimulationType.State = CY.Utility.Common.CodeInterface.PhaseState.GetStart();
                 }
                 else
                 {
                     stimulationType.State = CY.Utility.Common.CodeInterface.PhaseState.GetSetUp();
                 }
                 stimulationType.Save();
             }
         }
     }
 }