private void AttAndRemoveAttributeForExcel(List <ObjectitemTabTree> Items, string TypeName)
        {
            FilterExpression fe = myApplication.CreateFilter();

            fe.Add(AttributeId.Designation, BinaryOperator.Equal, TypeName);
            var oc = myApplication.Folders.TypeDefinitions.FindObjects(fe, SearchBehavior.Hierarchical, true).FirstOrDefault();

            foreach (var Tab in Items)
            {
                if (!Tab.TabTreeName.Contains("System Attributes"))
                {
                    foreach (var att in Tab.TabTreeChildren)
                    {
                        int ssid = int.Parse(att.AddedId);

                        try
                        {
                            oc.Attributes.AddAttributeToMask((AttributeId)ssid, Tab.TabTreeName);
                        }
                        catch
                        {
                            System.Windows.MessageBox.Show(" Atribute " + ssid + " Already Exist in " + Tab.TabTreeName);
                        }
                    }
                }
                else
                {
                    System.Windows.MessageBox.Show(" Cant Add attributes to " + Tab.TabTreeName + " yet !!");
                }
            }
        }
Beispiel #2
0
        private void AddFilterExpression(Expression expression)
        {
            if (FilterExpression == null)
            {
                FilterExpression = new DynamoExpression(AttributeNames, AttributeValues);
            }

            FilterExpression.Add(expression);
        }
Beispiel #3
0
        private ObjectItem searchTypeFromDefination(string typeName)
        {
            FilterExpression fe = myApplication.CreateFilter();

            fe.Add(AttributeId.Designation, BinaryOperator.Equal, typeName);
            var typeObj = myApplication.Folders.TypeDefinitions.FindObjects(fe, SearchBehavior.Hierarchical, true).FirstOrDefault();

            return(typeObj);
        }
Beispiel #4
0
        private static List <int> FetchDataModel(StackAppContext appContext, int parentId, BaseField parentField, IDBEntity entity)
        {
            var filterExp = new FilterExpression(entity.EntityId);
            var relField  = (OneToManyField)parentField;

            filterExp.Add(new FilterExpField(relField.RefFieldName, FilterOperationType.Equal, parentId));
            var ids = entity.ReadIds(appContext, filterExp);

            return(ids);
        }
        protected override void PrepareFilter(DbQuery query, DataListDefinition defn)
        {
            var itemId    = RequestQuery.ItemId;
            var filterExp = new FilterExpression(SourceEntityId);
            var relField  = (RelationalField)EntityField;

            filterExp.Add(new FilterExpField(relField.RefFieldName, FilterOperationType.Equal, itemId));

            query.SetFixedFilter(filterExp);
        }
        public DBModelBase Read(StackAppContext appContext, int id, List <string> fields)
        {
            var exp = new FilterExpression(this.EntityId);

            exp.Add(new FilterExpField(this.IDField, FilterOperationType.Equal, id));

            var d = ReadAll(appContext, fields, exp);

            if (d.Count > 0)
            {
                return(d.First());
            }

            throw new UserException("Record is not available with id: " + id.ToString());
        }
Beispiel #7
0
        private ObjectCollection searchAttribute(List <ObjectMaskDescription> Attributes)
        {
            ObjectCollection      AttObj = null;
            MultiFilterExpression fa     = myApplication.CreateMultiFilter();
            int i = 0;

            foreach (var item in Attributes)
            {
                i++;
                FilterExpression fe = myApplication.CreateFilter();
                fe.Add(AttributeId.Designation, BinaryOperator.Equal, item.Name);
                fa.AddFilter(fe);
            }
            return(AttObj);
        }
        private void AttAndRemoveAttributeForExcel(List <MaskDescriptionModel> data, string TypeName)
        {
            FilterExpression fe = myApplication.CreateFilter();

            fe.Add(AttributeId.Designation, BinaryOperator.Equal, TypeName);
            var oc = myApplication.Folders.TypeDefinitions.FindObjects(fe, SearchBehavior.Hierarchical, true).FirstOrDefault();

            foreach (var obj in data)
            {
                foreach (var item in obj.AttibuteNameAndID)
                {
                    int ssid = int.Parse(item.AttributesIdString);

                    if (String.Equals(item.Function, "ADD", StringComparison.OrdinalIgnoreCase))
                    {
                        try
                        {
                            oc.Attributes.AddAttributeToMask((AttributeId)ssid, obj.TabNameString);
                        }
                        catch
                        {
                            System.Windows.MessageBox.Show(" Atribute " + ssid + " Already Exist in " + obj.TabNameString);
                        }
                    }
                    else if (String.Equals(item.Function, "REMOVE", StringComparison.OrdinalIgnoreCase))
                    {
                        try
                        {
                            oc.Attributes.Remove((AttributeId)ssid);
                        }
                        catch (Exception ex)
                        {
                            //System.Windows.MessageBox.Show(" Atribute " + ssid + " Does Not Exist To Remove " + obj.TabNameString);
                            System.Windows.MessageBox.Show(ex.Message);
                        }
                    }
                    else
                    {
                        System.Windows.MessageBox.Show(" Nothing to Remove Or Add Please Check If ADD OR REMOVE Word Has Been Added To Coloum C ");
                    }
                }
            }
        }
            private List <ObjectCollection> searchAttribute(List <ObjectMaskDescription> Attributes)
            {
                ObjectCollection        AttObj     = null;
                List <ObjectCollection> AttObjList = new List <ObjectCollection>();
                MultiFilterExpression   fa         = myApplication.CreateMultiFilter();
                int i = 0;

                try
                {
                    if (Attributes.Count != 0)
                    {
                        foreach (var item in Attributes)
                        {
                            i++;
                            FilterExpression fe = myApplication.CreateFilter();
                            var sxc             = (int)item.ID;
                            //fe.FindById((AttributeId)sxc);
                            fe.Add((AttributeId.Aid), BinaryOperator.Equal, sxc);
                            fa.AddFilter(fe);
                            if (i == 25)
                            {
                                AttObj = myApplication.Folders.Attributes.FindObjects(fa, true);
                                fe     = myApplication.CreateFilter();
                                AttObjList.Add(AttObj);
                            }
                            else if (i == 50)
                            {
                                AttObj = myApplication.Folders.Attributes.FindObjects(fa, true);
                                fe     = myApplication.CreateFilter();
                                AttObjList.Add(AttObj);
                            }
                        }
                        AttObj = myApplication.Folders.Attributes.FindObjects(fa, SearchBehavior.Deep);

                        var t = from u in AttObj from k in Attributes where u.Name != k.Name select k;
                        AttObjList.Add(AttObj);
                    }
                }
                catch { System.Windows.MessageBox.Show("Finding Attribute Failed", "System Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error); }
                return(AttObjList);
            }
Beispiel #10
0
        public int AuthenticateUser(string loginId, string pwd, out string email)
        {
            var exp = new FilterExpression(this.EntityId);

            exp.Add(new FilterExpField("loginid", FilterOperationType.Equal, loginId));
            var data = UserDbService.GetUserInfoForAuth(loginId);

            email = null;

            if (data.Count() > 0)
            {
                var d = data.First();
                email = d.Get("emailid", "");

                var userpwd = Decrypt(d.Get("Password", ""));

                if (pwd == userpwd)
                {
                    return(d.Get("id", 0));
                }
            }

            return(-1);
        }
Beispiel #11
0
        private void AddFilterExpression(Expression expression)
        {
            FilterExpression ??= new DynamoExpression(AttributeNames, AttributeValues);

            FilterExpression.Add(expression);
        }