Beispiel #1
0
        protected override bool Execute(CodeActivityContext context)
        {
            int obj_id = ObjectID.Get(context);


            List <usp2_Info_GetFormulaHierarchy_ListResult> vallist = null;

            try
            {
                var res = ARM_Service.FL_GetFormulaHierarchy_List(obj_id, (enumTypeHierarchy)ObjectType);
                if (res != null)
                {
                    vallist = res.FormulaHierarchy;
                }
            }

            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }

            if (vallist == null)
            {
                vallist = new List <usp2_Info_GetFormulaHierarchy_ListResult>();
            }
            FormulsList.Set(context, vallist);

            return(string.IsNullOrEmpty(Error.Get(context)));
        }
        protected override bool Execute(CodeActivityContext context)
        {
            //Login не возвращает ID пока пишем в user_ID логин и ставим галку
            string user_ID    = User_ID.Get(context);
            string eventSting = EventString.Get(context);

            byte   applicationType  = ApplicationType.Get(context);
            string commentString    = CommentString.Get(context);
            string parentObjectID   = ParentObjectID.Get(context);
            string parentObjectName = ParentObjectName.Get(context);
            string objectID         = ObjectID.Get(context);
            string bjectName        = ObjectName.Get(context);
            byte   eventType        = EventType.Get(context);

            try
            {
                DeclaratorService.Insert_ExplUserJournal(user_ID, eventSting, commentString, applicationType, 0, eventType, bjectName, objectID, parentObjectName, parentObjectID,
                                                         true);
            }
            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
            }


            return(string.IsNullOrEmpty(Error.Get(context)));
        }
Beispiel #3
0
        protected override bool Execute(CodeActivityContext context)
        {
            object obj_id = ObjectID.Get(context);

            if (obj_id == null)
            {
                Error.Set(context, "Не опреден идентификатор объекта");
                return(false);
            }

            SummValues.Set(context, 0);
            Status.Set(context, (int)VALUES_FLAG_DB.DataNotFull);
            StatusStr.Set(context, TVALUES_DB.FLAG_to_String(VALUES_FLAG_DB.DataNotFull, ";"));

            var found = false;
            List <TVALUES_DB> vallist = null;

            try
            {
                var tidList   = new List <ID_Hierarchy_Channel>();
                var IH_Chanel = new ID_Hierarchy_Channel();
                IH_Chanel.ID            = obj_id.ToString();
                IH_Chanel.TypeHierarchy = (enumTypeHierarchy)ObjectType;
                IH_Chanel.Channel       = (byte)Channel;
                tidList.Add(IH_Chanel);

                //TODO часовой пояс
                var res = ARM_Service.DS_GetArchivesHierObjectLastHalfHours(
                    tidList,
                    IsCoeffEnabled,
                    StartDateTime.Get(context),
                    EndDateTime.Get(context),
                    DataSourceType,
                    DiscreteType, UnitDigit, false, null);


                if (res != null && res.Result_Values != null && res.Result_Values.Count > 0)
                {
                    var resultValues = new Dictionary <ID_Hierarchy_Channel, List <TVALUES_DB> >(res.Result_Values, new ID_Hierarchy_Channel_EqualityComparer());

                    if (resultValues.TryGetValue(IH_Chanel, out vallist) && vallist != null)
                    {
                        found = true;
                        var R = vallist.Accomulate();
                        SummValues.Set(context, R.F_VALUE);
                        Status.Set(context, (int)R.F_FLAG);
                        StatusStr.Set(context, TVALUES_DB.FLAG_to_String(R.F_FLAG, ";"));
                    }
                }
            }

            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }

            if (vallist == null)
            {
                vallist = new List <TVALUES_DB>();
            }
            ValueList.Set(context, vallist);

            return(string.IsNullOrEmpty(Error.Get(context)));
        }