Example #1
0
        private void Add_New_List(List <Abstract_Iter_able> list)
        {
            Facade_Table_Facade       facade_Table_Facade = new Facade_Table_Facade();
            List <Abstract_Iter_able> return_List         = new List <Abstract_Iter_able>();
            List <Abstract_Iter_able> table = facade_Table_Facade.JB_GetAll();

            foreach (Abstract_Iter_able item in list)
            {
                List <Abstract_Iter_able> existing_List = facade_Table_Facade.GetByIdWhere(item.GetType().ToString(), "Facade_Name");
                if (existing_List.Count() == 0)
                {
                    return_List.Add(item);
                }
            }
            Update_List(table);
            Add_List(return_List);
            return;
        }
Example #2
0
        private List <string> Update_List(List <Abstract_Iter_able> abstract_List)
        {
            List <string>       return_List   = new List <string>();
            Facade_Table_Facade facade_Facade = new Facade_Table_Facade();

            foreach (Abstract_Iter_able jB_Abstract in abstract_List)
            {
                List <Abstract_Iter_able> existing_List = facade_Facade.GetByIdWhere(jB_Abstract.GetType().ToString(), "Facade_Name");
                if (existing_List.Count() > 0)
                {
                    Facade_Table facade = (Facade_Table)existing_List[0];
                    facade.Facade_Description = ((Facade_Table)jB_Abstract).Facade_Description;
                    facade.Facade_Name        = jB_Abstract.GetType().ToString();
                    MemoryStream memStream = new MemoryStream();
                    StreamWriter sw        = new StreamWriter(memStream);
                    sw.Write(jB_Abstract);
                    facade.Facade_Obj = memStream.GetBuffer();
                    return_List.Add(facade.Facade_ID.ToString());
                    facade_Facade.Add(facade);
                }
            }
            return(return_List);
        }