Exemplo n.º 1
0
        public override TaskAssignedObject CreateNewData(DataRow row)
        {
            SchemaType type = (SchemaType)Enum.Parse(typeof(SchemaType), row["ASSIGNEE_TYPE"].ToString(), true);

            IOguObject obj = OguBase.CreateWrapperObject(row["ASSIGNEE_ID"].ToString(), type);

            TaskAssignedObject result = new TaskAssignedObject();

            result.Assignee = obj;

            return(result);
        }
        private static void FillSqlBuilder <TBuilder>(TBuilder builder, StartWorkflowJob data) where TBuilder : SqlClauseBuilderIUW <TBuilder>
        {
            builder.AppendItem("JOB_ID", data.JobID);
            builder.AppendItem("PROCESS_KEY", data.ProcessKey);
            builder.AppendTenantCode(typeof(StartWorkflowJob));

            if (OguBase.IsNotNullOrEmpty(data.Operator))
            {
                builder.AppendItem("OPERATOR_ID", data.Operator.ID);
                builder.AppendItem("OPERATOR_NAME", data.Operator.DisplayName);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 序列化OguOrganization
        /// </summary>
        /// <param name="obj">material对象</param>
        /// <param name="serializer">序列化器</param>
        /// <returns>属性集合</returns>
        public override IDictionary <string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            try
            {
                OguBase oguObj = (OguBase)obj;

                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "id", oguObj.ID);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "name", oguObj.Name);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "__type", obj.GetType().AssemblyQualifiedName);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "displayName", oguObj.DisplayName);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "objectType", GetObjectSchemaType(oguObj));
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "description", oguObj.Description);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "fullPath", oguObj.FullPath);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "globalSortID", oguObj.GlobalSortID);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "levels", oguObj.Levels);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "sortID", oguObj.SortID);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "status", oguObj.Properties["STATUS"]);
                DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "tag", oguObj.Tag);

                dictionary.Add("clientContext", oguObj.ClientContext);

                switch (oguObj.ObjectType)
                {
                case SchemaType.Organizations:
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "customsCode", ((IOrganization)oguObj).CustomsCode);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "departmentClass", ((IOrganization)oguObj).DepartmentClass);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "departmentType", ((IOrganization)oguObj).DepartmentType);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "rank", ((IOrganization)oguObj).Rank);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "excludeVirtualDepartment", ((IVirtualOrganization)oguObj).ExcludeVirtualDepartment, false);
                    break;

                case SchemaType.Users:
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "email", ((IUser)oguObj).Email);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "isSideline", ((IUser)oguObj).IsSideline);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "logOnName", ((IUser)oguObj).LogOnName);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "occupation", ((IUser)oguObj).Occupation);
                    DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "rank", ((IUser)oguObj).Rank);
                    break;

                case SchemaType.Groups:
                    break;
                }
            }
            catch (System.Exception)
            {
            }

            return(dictionary);
        }
Exemplo n.º 4
0
        public T this[int index]
        {
            get
            {
                return((T)List[index]);
            }
            set
            {
                ExceptionHelper.FalseThrow <ArgumentNullException>(value != null, "value");

                IOguObject data = value;

                if ((value is OguBase) == false)
                {
                    data = OguBase.CreateWrapperObject(value);
                }

                List[index] = data;
            }
        }
Exemplo n.º 5
0
        protected virtual void ExtractOguObject(IDictionary<string, object> dictionary, out SchemaType oguType, out OguBase result)
        {
            string id = (string)dictionary["id"];
            oguType = SchemaType.Users;

            if (dictionary.ContainsKey("objectType"))
                oguType = (SchemaType)dictionary["objectType"];

            result = CreateOguObject(oguType, id);

            result.Description = DictionaryHelper.GetValue(dictionary, "description", string.Empty);
            result.DisplayName = DictionaryHelper.GetValue(dictionary, "displayName", string.Empty);
            result.FullPath = DictionaryHelper.GetValue(dictionary, "fullPath", string.Empty);
            result.GlobalSortID = DictionaryHelper.GetValue(dictionary, "globalSortID", string.Empty);
            result.Name = DictionaryHelper.GetValue(dictionary, "name", string.Empty);
            result.SortID = DictionaryHelper.GetValue(dictionary, "sortID", string.Empty);
            result.Tag = DictionaryHelper.GetValue(dictionary, "tag", string.Empty);
            result.ClientContext = DictionaryHelper.GetValue(dictionary, "clientContext", (Dictionary<string, object>)null);

            if (dictionary.ContainsKey("status"))
                result.Properties["STATUS"] = DictionaryHelper.GetValue(dictionary, "status", 1);
        }
Exemplo n.º 6
0
 protected virtual OguBase CreateOguObject(SchemaType oguType, string id)
 {
     return((OguBase)OguBase.CreateWrapperObject(id, oguType));
 }
Exemplo n.º 7
0
        protected virtual void ExtractOguObject(IDictionary <string, object> dictionary, out SchemaType oguType, out OguBase result)
        {
            string id = (string)dictionary["id"];

            oguType = SchemaType.Users;

            if (dictionary.ContainsKey("objectType"))
            {
                oguType = (SchemaType)dictionary["objectType"];
            }

            result = CreateOguObject(oguType, id);

            result.Description   = DictionaryHelper.GetValue(dictionary, "description", string.Empty);
            result.DisplayName   = DictionaryHelper.GetValue(dictionary, "displayName", string.Empty);
            result.FullPath      = DictionaryHelper.GetValue(dictionary, "fullPath", string.Empty);
            result.GlobalSortID  = DictionaryHelper.GetValue(dictionary, "globalSortID", string.Empty);
            result.Name          = DictionaryHelper.GetValue(dictionary, "name", string.Empty);
            result.SortID        = DictionaryHelper.GetValue(dictionary, "sortID", string.Empty);
            result.Tag           = DictionaryHelper.GetValue(dictionary, "tag", string.Empty);
            result.ClientContext = DictionaryHelper.GetValue(dictionary, "clientContext", (Dictionary <string, object>)null);

            if (dictionary.ContainsKey("status"))
            {
                result.Properties["STATUS"] = DictionaryHelper.GetValue(dictionary, "status", 1);
            }
        }
Exemplo n.º 8
0
 protected override void InnerAdd(T obj)
 {
     obj = (T)OguBase.CreateWrapperObject(obj);
     base.InnerAdd(obj);
 }