public static ContactList GetAddressListFromGoogle(string username, string password)
        {
            ContactList list = new ContactList();
            list.Username = username;

            string appName = "adrianj-GoogleContactsMap-1";
            ContactsService service = CreateService(username, password, appName);

            int contactsPerQuery = 50;
            int maxTotal = 32000;
            ContactsQuery query = new ContactsQuery(ContactsQuery.CreateContactsUri("default"));
            query.NumberToRetrieve = contactsPerQuery;

            for (int index = 0; index < maxTotal; index += contactsPerQuery)
            {
                query.StartIndex = index;
                ContactsFeed feed = GetContactsFeed(query, service);
                list.ValidCredentials = true;
                list.AddFromFeed(feed);
                if (feed.Entries.Count < contactsPerQuery)
                    break;
            }

            return list;
        }
Ejemplo n.º 2
0
 public CollisionEventArgs(object self, object other, ContactList contactList, GameTime collisionTime)
 {
     this.Self = self;
     this.Other = other;
     this.ContactList = contactList;
     this.CollisionTime = collisionTime;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Finds the contactpoints between the two geometries.
        /// </summary>
        /// <param name="geomA">The first geom.</param>
        /// <param name="geomB">The second geom.</param>
        /// <param name="contactList">The contact list.</param>
        public void Collide(Geom geomA, Geom geomB, ContactList contactList)
        {
            int vertexIndex = -1;

            //Lookup distancegrid A data from list
            DistanceGridData geomAGridData = _distanceGrids[geomA.id];

            //Iterate the second geometry vertices
            for (int i = 0; i < geomB.worldVertices.Count; i++)
            {
                if (contactList.Count == PhysicsSimulator.MaxContactsToDetect)
                    break;

                vertexIndex += 1;
                _vertRef = geomB.WorldVertices[i];
                geomA.TransformToLocalCoordinates(ref _vertRef, out _localVertex);

                //The geometry intersects when distance <= 0
                //Continue in the list if the current vector does not intersect
                if (!geomAGridData.Intersect(ref _localVertex, out _feature))
                    continue;

                //If the geometries collide, create a new contact and add it to the contact list.
                if (_feature.Distance < 0f)
                {
                    geomA.TransformNormalToWorld(ref _feature.Normal, out _feature.Normal);
                    Contact contact = new Contact(geomB.WorldVertices[i], _feature.Normal, _feature.Distance,
                                                  new ContactId(1, vertexIndex, 2));
                    contactList.Add(contact);
                }
            }

            //Lookup distancegrid B data from list
            DistanceGridData geomBGridData = _distanceGrids[geomB.id];

            //Iterate the first geometry vertices
            for (int i = 0; i < geomA.WorldVertices.Count; i++)
            {
                if (contactList.Count == PhysicsSimulator.MaxContactsToDetect)
                    break;

                vertexIndex += 1;
                _vertRef = geomA.WorldVertices[i];
                geomB.TransformToLocalCoordinates(ref _vertRef, out _localVertex);

                if (!geomBGridData.Intersect(ref _localVertex, out _feature))
                    continue;

                if (_feature.Distance < 0f)
                {
                    geomB.TransformNormalToWorld(ref _feature.Normal, out _feature.Normal);
                    _feature.Normal = -_feature.Normal;
                    Contact contact = new Contact(geomA.WorldVertices[i], _feature.Normal, _feature.Distance,
                                                  new ContactId(2, vertexIndex, 1));
                    contactList.Add(contact);
                }
            }
        }
Ejemplo n.º 4
0
 protected bool oncollision(Geom geom1, Geom geom2, ContactList contact)
 {
     Iid id1 = (Iid)geom1.Tag;
     Iid id2 = (Iid)geom2.Tag;
     if (id1.UnitID == UnitID.obstacle && id2.UnitID == UnitID.player)
     {
         master.players[id2.NodeID].body.ApplyForce(this.rotationV2 * 4333333);
         master.players[id2.NodeID].addPush(4000f);
     }
     return false;
 }
        public ContactList GetContactList()
        {
            List<ContactView> contactViewList = _contactService.GetContactViewList();
             ContactList contactList = new ContactList();

             foreach (ContactView contactView in contactViewList)
             {
            contactList.Add(new Contact() { Id = contactView.Id, FirstName = contactView.FirstName.Trim(), LastName = contactView.LastName.Trim(), Email = contactView.Email.Trim() });
             }

             return contactList;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Returns the contact list from two possibly intersecting Geom's. 
        /// This is the stationary version of this function. It doesn't 
        /// account for linear or angular motion.
        /// </summary>
        /// <param name="geomA">The first Geom.</param>
        /// <param name="geomB">The second Geom.</param>
        /// <param name="contactList">Set of Contacts between the two Geoms.
        /// NOTE- this will be empty if no contacts are present.</param>
        public void Collide(Geom geomA, Geom geomB, ContactList contactList)
        {
            PolygonCollisionResult result = PolygonCollision(geomA.WorldVertices, geomB.WorldVertices, geomB.body.LinearVelocity - geomA.body.LinearVelocity);
            float distance = result.MinimumTranslationVector.Length();
            int contactsDetected = 0;
            Vector2 normal = Vector2.Normalize(-result.MinimumTranslationVector);

            if (result.Intersect)
            {
                for (int i = 0; i < geomA.WorldVertices.Count; i++)
                {
                    if (contactsDetected <= PhysicsSimulator.MaxContactsToDetect)
                    {
                        if (InsidePolygon(geomB.WorldVertices, geomA.WorldVertices[i]))
                        {
                            if (!geomA.Body.IsStatic)
                            {
                                if (distance > 0.001f)
                                {
                                    Contact c = new Contact(geomA.WorldVertices[i], normal, -distance, new ContactId(geomA.id, i, geomB.id));
                                    contactList.Add(c);
                                    contactsDetected++;
                                }
                            }
                        }
                    }
                    else break;
                }

                contactsDetected = 0;

                for (int i = 0; i < geomB.WorldVertices.Count; i++)
                {
                    if (contactsDetected <= PhysicsSimulator.MaxContactsToDetect)
                    {
                        if (InsidePolygon(geomA.WorldVertices, geomB.WorldVertices[i]))
                        {
                            if (!geomB.Body.IsStatic)
                            {
                                if (distance > 0.001f)
                                {
                                    Contact c = new Contact(geomB.WorldVertices[i], normal, -distance, new ContactId(geomB.id, i, geomA.id));
                                    contactList.Add(c);
                                    contactsDetected++;
                                }
                            }
                        }
                    }
                    else break;
                }
            }
        }
        public void TestSerializeContactList()
        {
            ContactList contactList = new ContactList();

            Contact contact = new Contact
            {
                FirstName = "Dimitar",
                LastName = "Dimitrov",
                Accounts = Accounts.Facebook | Accounts.Google,
                Address = "Darmstadt, Germany",
                Phone = "+49 (6151) 16 - 23205",
                Email = "*****@*****.**"
            };
            contactList.Add(contact);

            contact = new Contact
            {
                FirstName = "David",
                LastName = "Gueswell",
                Accounts = Accounts.Facebook,
                Address = "Darmstadt, Germany",
                Phone = "+49 (6151) 16 - 23205",
                Email = "*****@*****.**"
            };
            contactList.Add(contact);

            contact = new Contact
            {
                FirstName = "Hans",
                LastName = "Becker",
                Accounts = Accounts.Facebook,
                Address = "Darmstadt, Germany",
                Phone = "+49 (6151) 16 - 23205",
                Email = "*****@*****.**"
            };
            contactList.Add(contact);

            // Serialization
            string serializedObject = Serializer.Serialize(contactList);

            Assert.IsFalse(string.IsNullOrEmpty(serializedObject));
            Assert.IsTrue(serializedObject.Contains("Dimitar"));
            Assert.IsTrue(serializedObject.Contains("David"));
            Assert.IsTrue(serializedObject.Contains("Hans"));

            var contactListDeserialized = Serializer.Deserialize<ContactList>(serializedObject);
            Assert.IsNotNull(contactListDeserialized);
            Assert.IsTrue(contactListDeserialized.Count == 3);
        }
        public ContactList GetContact(string Id)
        {
            ContactList contactList = new ContactList();
             ContactView contactView = null;
             Contact contact = new Contact();

             contactView = _contactService.GetContactView(int.Parse(Id));
             contact.Id = contactView.Id;
             contact.FirstName = contactView.FirstName.Trim();
             contact.LastName = contactView.LastName.Trim();
             contact.Email = contactView.Email.Trim();
             contactList.Add(contact);

             return contactList;
        }
Ejemplo n.º 9
0
            static void Main(string[] args)
            {
                Contact my = new Contact("Alex", "Kaplunov", 22, "+380-50-50-38-222", "Ukraine, Odessa");
                ContactList Contacts = new ContactList();
                Contacts.Add(my);
                Contacts.Add(my);
                Contacts.Add(my);
                Contacts.Add(my);

                XmlSerializer xml = new XmlSerializer(typeof(ContactList));
                using (var fStream = new FileStream("./ContactList.xml", FileMode.Create, FileAccess.Write, FileShare.None))
                {
                    xml.Serialize(fStream, Contacts);
                }
            }
Ejemplo n.º 10
0
        static async Task SetPictureUri(ContactList contactList)
        {
            //return Task.Run(async () =>
            //{
            if (contactList == null)
                return;

            foreach (var contact in contactList)
            {
                if (!string.IsNullOrEmpty(contact.Picture))
                {
                    try
                    {
                        //Not working :(
                        //string fullPaths = $@"ms-appx:///ConTangibles/Assets/Data/Pictures/{contact.Picture}";
                        //Uri uri = new Uri(fullPaths);

                        var file = await InstallationFolder.GetFileAsync($@"Assets\Data\Pictures\{contact.Picture}");


                        var stream = await file.OpenAsync(FileAccessMode.Read);
                        BitmapImage image = new BitmapImage();
                        await image.SetSourceAsync(stream);



                        contact.PictureSource = image;
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine(ex.ToString());
                    }
                }
            }

            //});


        }
Ejemplo n.º 11
0
        internal override void Store(ContactList list, object descriptor)
        {
            FileStream fs = null;
            try
            {
                fs = File.Open(descriptor as string, FileMode.Create);
            }
            catch
            {
                throw new ArgumentException("Invalid file name");
            }

            try
            {
                DataContractSerializer dcs = new DataContractSerializer(typeof(ContactList));
                dcs.WriteObject(fs, list);
            }
            finally
            {
                fs.Close();
            }
        }
Ejemplo n.º 12
0
        protected virtual bool HandleCollision(Geom geom1, Geom geom2, ContactList list)
        {
            Geom other;
            if (geom1 == this.geometry)
            {
                other = geom2;
            }
            else
            {
                other = geom1;
            }

            if (other.Tag is MapUnit)
            {
                Page.SceneLoop.Update += new System.EventHandler<SceneLoopEventArgs>(SceneLoop_Update);
            }
            else if (other.Tag is Projectile)
            {
                this.HandleProjectileHit(other.Tag as Projectile);
            }

            return true;
        }
Ejemplo n.º 13
0
 public PlayStartupManager(UserSettings settings, IShutdownHandler shutdownHandler,
     IFirstTimeLicense firstTimeLicense, ISystemInfo systemInfo, IUserSettingsStorage storage,
     ISoftwareUpdate softwareUpdate, Container container, ICacheManager cacheManager,
     Cache.ImageFileCache imageFileCache,
     IPreRequisitesInstaller prerequisitesInstaller, ContactList contactList,
     IContentManager contentManager, IDialogManager dialogManager,
     VersionRegistry versionRegistry, Lazy<IUpdateManager> updateManager)
     : base(systemInfo, cacheManager, dialogManager) {
     _settings = settings;
     _shutdownHandler = shutdownHandler;
     _firstTimeLicense = firstTimeLicense;
     _softwareUpdate = softwareUpdate;
     _container = container;
     _imageFileCache = imageFileCache;
     _prerequisitesInstaller = prerequisitesInstaller;
     _contactList = contactList;
     _contentManager = contentManager;
     _dialogManager = dialogManager;
     _versionRegistry = versionRegistry;
     _updateManager = updateManager;
     _systemInfo = systemInfo;
     _storage = storage;
 }
Ejemplo n.º 14
0
 public PlayStartupManager(UserSettings settings, IShutdownHandler shutdownHandler,
                           IFirstTimeLicense firstTimeLicense, ISystemInfo systemInfo, IUserSettingsStorage storage,
                           ISoftwareUpdate softwareUpdate, Container container, ICacheManager cacheManager,
                           Cache.ImageFileCache imageFileCache,
                           IPreRequisitesInstaller prerequisitesInstaller, ContactList contactList,
                           IContentManager contentManager, IDialogManager dialogManager,
                           VersionRegistry versionRegistry, Lazy <IUpdateManager> updateManager, ISpecialDialogManager specialDialogManager)
     : base(cacheManager, dialogManager, specialDialogManager)
 {
     _settings               = settings;
     _shutdownHandler        = shutdownHandler;
     _firstTimeLicense       = firstTimeLicense;
     _softwareUpdate         = softwareUpdate;
     _container              = container;
     _imageFileCache         = imageFileCache;
     _prerequisitesInstaller = prerequisitesInstaller;
     _contactList            = contactList;
     _contentManager         = contentManager;
     _dialogManager          = dialogManager;
     _versionRegistry        = versionRegistry;
     _updateManager          = updateManager;
     _systemInfo             = systemInfo;
     _storage = storage;
 }
Ejemplo n.º 15
0
 private void LoadContact()
 {
     ContactList.Add(new ContactItemViewModel {
         Name = "Aaron", Number = 7363750
     });
     ContactList.Add(new ContactItemViewModel {
         Name = "Adam", Number = 7323250
     });
     ContactList.Add(new ContactItemViewModel {
         Name = "Adrian", Number = 7239121
     });
     ContactList.Add(new ContactItemViewModel {
         Name = "Alwin", Number = 2329823
     });
     ContactList.Add(new ContactItemViewModel {
         Name = "Alex", Number = 8013481
     });
     ContactList.Add(new ContactItemViewModel {
         Name = "Alexander", Number = 7872329
     });
     ContactList.Add(new ContactItemViewModel {
         Name = "Barry", Number = 7317750
     });
 }
Ejemplo n.º 16
0
        public void Initialize()
        {
            _contactList = new ContactList();
            _viewModel   = new ContactListViewModel(_contactList);
            _contactList.AddContact(new Contact()
            {
                FirstName = "Michael", LastName = "Perry"
            });
            _contactList.AddContact(new Contact()
            {
                FirstName = "Ada", LastName = "Lovelace"
            });
            _contactList.AddContact(new Contact()
            {
                FirstName = "Charles", LastName = "Babbage"
            });

            _collectionChangedCount = 0;
            _viewModel.ContactsCollectionChanged +=
                delegate
            {
                _collectionChangedCount++;
            };
        }
Ejemplo n.º 17
0
        public async Task <IActionResult> Index(int?ID)
        {
            var contacts = from m in _context.ContactDetails
                           select m;

            var clickedContact = new ContactDetails();

            if (ID.HasValue)
            {
                clickedContact        = contacts.Where(s => s.ID == ID).FirstOrDefault();
                ViewData["isClicked"] = true;
            }
            else
            {
                ViewData["isClicked"] = false;
            }

            var contactsList = new ContactList();

            contactsList.Contacts = await contacts.ToListAsync();

            contactsList.clickedContact = clickedContact;
            return(View(contactsList));
        }
Ejemplo n.º 18
0
        internal static ContactList getContactList(HttpResponseMessage responce)
        {
            var contactList = new ContactList();
            var jsonObj     =
                JsonConvert.DeserializeObject <Dictionary <string, object> >(responce.Content.ReadAsStringAsync().Result);

            if (jsonObj.ContainsKey("contacts"))
            {
                var contactsArray = JsonConvert.DeserializeObject <List <object> >(jsonObj["contacts"].ToString());
                foreach (var contactObj in contactsArray)
                {
                    var contact = new Contact();
                    contact = JsonConvert.DeserializeObject <Contact>(contactObj.ToString());
                    contactList.Add(contact);
                }
            }
            if (jsonObj.ContainsKey("page_context"))
            {
                var pageContext = new PageContext();
                pageContext = JsonConvert.DeserializeObject <PageContext>(jsonObj["page_context"].ToString());
                contactList.page_context = pageContext;
            }
            return(contactList);
        }
Ejemplo n.º 19
0
        public TestWindow()
        {
            InitializeComponent();

            timer          = new Timer();
            timer.Interval = (int)(STEP_TIME * 1000);
            timer.Tick    += Timer_Tick;
            timer.Start();

            scene    = new Scene();
            contacts = new ContactList();

            Body groundBody = Utilities.AddBody(scene);

            groundBody.Position             = new Vector2(400, 25);
            groundBody.StaticFriction       = 0.5F;
            groundBody.DynamicFriction      = 0.2F;
            groundBody.Restitution          = 0.2F;
            groundBody.Orientation.Rotation = 60 * Math.DegreesToRadians;
            groundBody.Shape = Utilities.CreateSquareShape(new Vector2(700, 30), new Vector2(0, 0));

            Body obstacleBody = Utilities.AddBody(scene);

            obstacleBody.Position        = new Vector2(400, 300);
            obstacleBody.StaticFriction  = 0.5F;
            obstacleBody.DynamicFriction = 0.2F;
            obstacleBody.Restitution     = 0.2F;
            obstacleBody.Shape           = Utilities.CreateCircleShape(50);

            config          = new Simulation.Config();
            config.StepTime = STEP_TIME;

            raycastInfo = new Raycaster.Info();

            editorCanvas1.LookAt(new PointF(400, 200));
        }
        private async Task <DialogTurnResult> DialogueComplete(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            Contact contact = await StatePropertyAccessor.ContactAccessor.GetAsync(stepContext.Context);

            ContactList contacts = await StatePropertyAccessor.ContactListAccessor.GetAsync(stepContext.Context);

            // take the Age from the previous step
            contact.age = int.Parse(stepContext.Result.ToString());

            if (contact.id > 0 && contact.age > 0 && !string.IsNullOrEmpty(contact.name))
            {
                await stepContext.Context.SendActivityAsync($"Successfully added contact with id of: { contact.id }, named: { contact.name} whos is { contact.age} years old.");

                contacts.Add(contact);
                // save list
                await StatePropertyAccessor.ContactListAccessor.SetAsync(stepContext.Context, contacts);

                return(await stepContext.EndDialogAsync());
            }
            else
            {
                return(await stepContext.ReplaceDialogAsync(this.Id));
            }
        }
Ejemplo n.º 21
0
        // GET: Contacts/Details/5
        public ActionResult Details(string id, string contactlist_id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            if (contactlist_id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var contactList = ContactList.find(contactlist_id);

            if (contactList == null)
            {
                return(HttpNotFound());
            }
            var contact = Contact.find(contactList, id);

            if (contact == null)
            {
                return(HttpNotFound());
            }
            return(View(contact));
        }
Ejemplo n.º 22
0
        public int checkPortalCollisions(cRigidBodyGameObject obj)
        {
            AABB aabb = obj.RigidBody.Geometry.AABB;
            ContactList newContactList = new ContactList(10);
            newContactList.Clear();

            if (AABB.Intersect(aabb, _portals[0].RigidBody.Geometry.AABB))
            {
                //Console.WriteLine("COLLISION 0");
                obj.RigidBody.Collide(_portals[0].RigidBody, newContactList);
                if (newContactList.Count != 0) { return 0; }
            }
            else if (AABB.Intersect(aabb, _portals[1].RigidBody.Geometry.AABB))
            {
                //Console.WriteLine("COLLISION 1");
                obj.RigidBody.Collide(_portals[1].RigidBody, newContactList);
                if (newContactList.Count != 0) { return 1; }
            }
            else
            {
                //Console.WriteLine("-------");
            }
            return -1;
        }
        public void openList()
        {
            try
            {
                Console.WriteLine("Path:");
                string path = Console.ReadLine().Trim();
                using (var stream = new FileStream(path, FileMode.Open))
                    using (var reader = XmlReader.Create(stream))
                    {
                        var serial = new XmlSerializer(typeof(ContactList));
                        Process.CreateList(path);

                        ContactList contacts = serial.Deserialize(stream) as ContactList;
                        foreach (Contact c in contacts.Contacts)
                        {
                            Process.uzing.Contacts.Add(c);
                        }
                    }
            }
            catch (Exception)
            {
                Console.WriteLine($"File Path Exception");
            }
        }
        /// <summary>
        /// Make sure the data in our contact and the other contact are the same. If we update, then save it.
        /// </summary>
        /// <param name="uwpContact"></param>
        /// <param name="ourContact"></param>
        /// <returns></returns>
        private static async Task SyncContact(ContactList uwpList, Contact uwpContact, IContact ourContact)
        {
            // If somethign has changed, then we should resave.
            bool modified = false;

            if (uwpContact.FirstName != ourContact.FirstName)
            {
                modified             = true;
                uwpContact.FirstName = ourContact.FirstName;
            }
            if (uwpContact.LastName != ourContact.LastName)
            {
                modified            = true;
                uwpContact.LastName = ourContact.LastName;
            }

            if (modified)
            {
                await uwpList.SaveContactAsync(uwpContact);

                // Cache the contact so next time through we can be sure to properly sync things.
                ourContact.UniqueID = uwpContact.Id;
            }
        }
        private async void ContactList_SelectionChanged(object sender, EventArgs e)
        {
            Log.WriteLine(sender.GetType().Name);

            // fix scroll position
            ContactList.ScrollIntoView(ContactList.SelectedItem);

            // NOTE:
            // This private variable prevents event triggered by the manual assignment
            // to `IsSelected` in `SaveButton_Click`
            if (!_isItemClick)
            {
                return;
            }
            this._isItemClick = false;

            var item = ContactList.SelectedItem as Item;

            if (item != null && item.Id != null)
            {
                ResetMessage();

                // clear only error styles on field
                foreach (string field in contactFields)
                {
                    this.FeedbackField <TextBox>(FindName(field) as TextBox, false);
                }

                Contact contact = await _patientDb.GetContactById(item.Id.Value);

                if (contact != null)
                {
                    this.CurrentEntry = contact;
                }
            }
        }
Ejemplo n.º 26
0
        public void ModContact(params WeChatUser[] contact)
        {
            foreach (var item in contact)
            {
                if (item.IsRoomContact())  //这里不包含群聊
                {
                    continue;
                }

                var local = _allContactList.FirstOrDefault(p => p.UserName == item.UserName);
                if (local != null)
                {
                    _allContactList.Remove(local);
                    ContactList.Remove(local);
                }
                _allContactList.Add(item);
                if (item.StartChar != "公众号")
                {
                    ContactList.Add(item);
                }
            }

            ImageDownloadService.Add(contact.ToArray());
        }
Ejemplo n.º 27
0
        void InitialiseModel(IModel m)
        {
            m.Clear();

            ContactList l = m.CreateResource <ContactList>(contactListUri);

            l.ContainsContact.Add(CreateContact(m, "Hans", new List <string> {
                "Anton"
            }, "Meiser", new DateTime(1980, 11, 2), "*****@*****.**", "Deutschland", "Sackgasse 3", "85221", "Dachau"));
            l.ContainsContact.Add(CreateContact(m, "Peter", new List <string> {
                "Judith", "Ludwig"
            }, "Meiser", new DateTime(1981, 12, 7), "*****@*****.**", "Deutschland", "Blubweg 6", "12345", "München"));
            l.ContainsContact.Add(CreateContact(m, "Franz", new List <string> {
                "Hans", "Wurst"
            }, "Hubert", new DateTime(1976, 5, 11), "*****@*****.**", "Deutschland", "Siemensstraße 183", "09876", "Berlin"));
            l.ContainsContact.Add(CreateContact(m, "Isabell", new List <string> {
                "Merlin"
            }, "Peters", new DateTime(1977, 1, 27), "*****@*****.**", "Deutschland", "Walnussweg 4", "45637", "Bonn"));
            l.ContainsContact.Add(CreateContact(m, "Max", new List <string> (), "Benek", new DateTime(1989, 3, 22), "*****@*****.**", "Deutschland", "Traunweg 6", "48887", "Schweinfurt"));
            l.ContainsContact.Add(CreateContact(m, "Karsten", new List <string> {
                "Peter"
            }, "Oborn", new DateTime(1958, 7, 19), "*****@*****.**", "Deutschland", "Bei der Wurstfabrik 6", "37439", "Darmstadt"));
            l.ContainsContact.Add(CreateContact(m, "Sabrina", new List <string> {
                "Hans"
            }, "Neubert", new DateTime(1960, 8, 15), "*****@*****.**", "Deutschland", "Hanstraße 1", "55639", "Hanover"));
            l.ContainsContact.Add(CreateContact(m, "Rainer", new List <string> {
                "Maria"
            }, "Bader", new DateTime(1970, 4, 26), "*****@*****.**", "Deutschland", "Lalaweg 5", "86152", "Augsburg"));
            l.ContainsContact.Add(CreateContact(m, "Maria", new List <string> {
                "Franz"
            }, "Roßmann", new DateTime(1968, 10, 6), "*****@*****.**", "Deutschland", "Münchner Straße 9", "85123", "Odelzhausen"));
            l.ContainsContact.Add(CreateContact(m, "Helga", new List <string> {
                "Isabell"
            }, "Rößler", new DateTime(1988, 2, 1), "*****@*****.**", "Deutschland", "Weiterweg 15", "12345", "München"));
            l.Commit();
        }
        /// <summary>
        /// Returns a contact lists from the xml data
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        private static List <ContactList> GetContactListFromCampaignResponse(XPathNavigator node)
        {
            List <ContactList> result = new List <ContactList>();

            if (node.HasChildren)
            {
                node.MoveToFirstChild();
                {
                    do
                    {
                        switch (node.Name)
                        {
                        case EmailCampaignXmlNodeContactList:
                            ContactList contactList = new ContactList();
                            contactList.Id = GetContactListId(node);
                            result.Add(contactList);
                            break;
                        }
                    } while (node.MoveToNext());
                }
                node.MoveToParent();
            }
            return(result);
        }
Ejemplo n.º 29
0
    private async Task <IReadOnlyList <Contact> > ListContactsAsync()
    {
        ContactStore store = await Store();

        if (store != null)
        {
            ContactList list = await GetAsync();

            if (list != null)
            {
                ContactReader reader = list.GetContactReader();
                if (reader != null)
                {
                    ContactBatch batch = await reader.ReadBatchAsync();

                    if (batch != null)
                    {
                        return(batch.Contacts);
                    }
                }
            }
        }
        return(null);
    }
Ejemplo n.º 30
0
 public CollisionInfo(T subject, ContactList contacts)
 {
     Subject  = subject;
     Contacts = contacts ?? new ContactList();
 }
Ejemplo n.º 31
0
        public void ToSoodaObjectListGenericList()
        {
            List<Contact> gl = new List<Contact>();
            ContactList cl = new ContactList(gl.ToSoodaObjectList());
            Assert.AreEqual(0, cl.Count);

            using (new SoodaTransaction())
            {
                gl.Add(Contact.Mary);
                gl.Add(Contact.Ed);
                Assert.AreEqual(0, cl.Count);
                cl = new ContactList(gl.ToSoodaObjectList());
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Ed }, cl);

                // ArrayList should have been copied
                gl[1] = Contact.Mary;
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Ed }, cl);

                // should not affect the array
                cl.Add(Contact.Eva);
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Ed, Contact.Eva }, cl);
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Mary }, gl);
            }
        }
Ejemplo n.º 32
0
        private async void CreateTestContacts()
        {
            //
            // Creating two test contacts with email address and phone number.
            //

            Contact contact1 = new Contact();

            contact1.FirstName = "TestContact1";

            ContactEmail email1 = new ContactEmail();

            email1.Address = "*****@*****.**";
            contact1.Emails.Add(email1);

            ContactPhone phone1 = new ContactPhone();

            phone1.Number = "4255550100";
            contact1.Phones.Add(phone1);

            Contact contact2 = new Contact();

            contact2.FirstName = "TestContact2";

            ContactEmail email2 = new ContactEmail();

            email2.Address = "*****@*****.**";
            email2.Kind    = ContactEmailKind.Other;
            contact2.Emails.Add(email2);

            ContactPhone phone2 = new ContactPhone();

            phone2.Number = "4255550101";
            phone2.Kind   = ContactPhoneKind.Mobile;
            contact2.Phones.Add(phone2);

            // Save the contacts
            ContactList contactList = await _GetContactList();

            if (null == contactList)
            {
                return;
            }

            await contactList.SaveContactAsync(contact1);

            await contactList.SaveContactAsync(contact2);

            //
            // Create annotations for those test contacts.
            // Annotation is the contact meta data that allows People App to generate deep links
            // in the contact card that takes the user back into this app.
            //

            ContactAnnotationList annotationList = await _GetContactAnnotationList();

            if (null == annotationList)
            {
                return;
            }

            ContactAnnotation annotation = new ContactAnnotation();

            annotation.ContactId = contact1.Id;

            // Remote ID: The identifier of the user relevant for this app. When this app is
            // launched into from the People App, this id will be provided as context on which user
            // the operation (e.g. ContactProfile) is for.
            annotation.RemoteId = "user12";

            // The supported operations flags indicate that this app can fulfill these operations
            // for this contact. These flags are read by apps such as the People App to create deep
            // links back into this app. This app must also be registered for the relevant
            // protocols in the Package.appxmanifest (in this case, ms-contact-profile).
            annotation.SupportedOperations = ContactAnnotationOperations.ContactProfile;

            if (!await annotationList.TrySaveAnnotationAsync(annotation))
            {
                rootPage.NotifyUser("Failed to save annotation for TestContact1 to the store.", NotifyType.ErrorMessage);
                return;
            }

            annotation           = new ContactAnnotation();
            annotation.ContactId = contact2.Id;
            annotation.RemoteId  = "user22";

            // You can also specify multiple supported operations for a contact in a single
            // annotation. In this case, this annotation indicates that the user can be
            // communicated via VOIP call, Video Call, or IM via this application.
            annotation.SupportedOperations = ContactAnnotationOperations.Message |
                                             ContactAnnotationOperations.AudioCall |
                                             ContactAnnotationOperations.VideoCall;

            if (!await annotationList.TrySaveAnnotationAsync(annotation))
            {
                rootPage.NotifyUser("Failed to save annotation for TestContact2 to the store.", NotifyType.ErrorMessage);
                return;
            }

            rootPage.NotifyUser("Sample data created successfully.", NotifyType.StatusMessage);
        }
Ejemplo n.º 33
0
        public ActionResult VisitorActions(VisitorActionsViewModel visitorActionsViewModel, string SignUp, string Comment)
        {
            Parish thisParish = new Parish();
            People thisPerson = new People();

            // [email protected]
            // Comment:  if the Parish is Receiving comments, prepend to the Comments field
            if (Comment != "")
            {
                // TODO - add the HiddenFor to the control based on thisParish.RecieveComments
                thisParish = db.Parishes.Where(p => p.ID == visitorActionsViewModel.Parishes.ID).First();
                if (thisParish.RecieveComments)
                {
                    // Get the sender's first name:
                    string thisUserID = User.Identity.GetUserId();
                    thisPerson = db.Peoples.Where(w => w.ApplicationUserId == thisUserID).First();
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.Append("=========================\n");
                    stringBuilder.Append(thisPerson.FirstName);
                    stringBuilder.Append(" ");
                    stringBuilder.Append(thisPerson.LastName);
                    stringBuilder.Append(" says:\n");
                    stringBuilder.Append(Comment);
                    stringBuilder.Append("\n");
                    stringBuilder.Append(thisParish.Comments ?? "");
                    //stringBuilder.Append(asdf);
                    //thisParish.Comments =
                    //    "=========================\n" +
                    //    thisPerson.FirstName + " " + thisPerson.LastName + " says:\n" +
                    //    Comment + "\n" +
                    //    thisParish.Comments ?? "";
                    thisParish.Comments = stringBuilder.ToString();
                    db.SaveChanges();
                }
            }
            if (SignUp.ToUpper() == "Y")
            {
                // search the ContactList table for a record with the parishID & user's ID;
                // if the record is not there, add it

                // if the parish or the user is null, get them
                if (thisParish.ID == 0)
                {
                    thisParish = db.Parishes.Where(p => p.ID == visitorActionsViewModel.Parishes.ID).First();
                }
                if (thisPerson.ID == 0)
                {
                    string thisUserID = User.Identity.GetUserId();
                    thisPerson = db.Peoples.Where(w => w.ApplicationUserId == thisUserID).First();
                }
                // Search
                int count = db.ContactLists.Where(c => c.ParishId == thisParish.ID && c.PeopleId == thisPerson.ID).Count();
                if (count == 0)
                {
                    ContactList contactList = new ContactList();
                    contactList.ParishId = thisParish.ID;
                    contactList.PeopleId = thisPerson.ID;
                    db.ContactLists.Add(contactList);
                    db.SaveChanges();
                }
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 34
0
        private bool OnCollision(Geom geom1, Geom geom2, ContactList contactList)
        {
            Geom other = null;
            if (geom1 == geom)
            {
                other = geom2;
            }
            else if (geom2 == geom)
            {
                other = geom1;
            }

            if (other.Tag is Tile)
            {
                return CollideWithTile((Tile)other.Tag);
            }
            else if (other.Tag is Duck)
            {
                return CollideWithDuck((Duck)other.Tag);
            }
            else
            {
                return true;
            }
        }
Ejemplo n.º 35
0
 public bool oncollide(Geom geom1, Geom geom2, ContactList contactList)
 {
     Iid g1tag = (Iid)geom1.Tag;
     Iid g2tag = (Iid)geom2.Tag;
     //Geom 2 tag was never created, we don't know the type, so just return true
    
     //make sure this unit is the player
     if (g1tag.UnitID == UnitID.player)
     {
         //Go through the different types of unit ids
         switch (g2tag.UnitID)
         {
             case UnitID.bullet:
                 //take damage from the bullet
                 //apply force
                 if (!isShield)
                 {
                     bullet bullet = master.bullets[g2tag.NodeID];
                     this.addPush(bullet.getPush);
                     //todo: optimize this for the inline
                     this.body.ApplyForce(bullet.body.LinearVelocity * this.getPush);
                     master.triggerparticles("explosion", bullet.geom.Position);                           
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             case UnitID.tower:                    
                 return true;
             case UnitID.player:
                 return false;
             default:
                 return true;
         }
     }
     else
         return false;
 }
Ejemplo n.º 36
0
        private async void CustomerSupport_Click(object sender, RoutedEventArgs e)
        {
            // Get the PinnedContactManager for the current user.
            PinnedContactManager pinnedContactManager = PinnedContactManager.GetDefault();

            // Check whether pinning to the taskbar is supported.
            if (!pinnedContactManager.IsPinSurfaceSupported(PinnedContactSurface.Taskbar))
            {
                return;
            }

            // Get the contact list for this app.
            ContactList list = await GetContactListAsync();

            // Check if the sample contact already exists.
            Contact contact = await list.GetContactFromRemoteIdAsync(Constants.ContactRemoteId);


            if (contact == null)
            {
                // Create the sample contact.
                contact           = new Contact();
                contact.FirstName = "Clippy";
                contact.LastName  = "";
                contact.RemoteId  = Constants.ContactRemoteId;
                contact.Emails.Add(new ContactEmail {
                    Address = Constants.ContactEmail
                });
                contact.Phones.Add(new ContactPhone {
                    Number = Constants.ContactPhone
                });
                contact.SourceDisplayPicture = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/clippy.jpg"));

                await list.SaveContactAsync(contact);
            }

            if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5))
            {
                // Create a new contact annotation
                ContactAnnotation annotation = new ContactAnnotation();
                annotation.ContactId = contact.Id;

                // Add appId and contact panel support to the annotation
                String appId = "d9714431-a083-4f7c-a89f-fe7a38f759e4_75cr2b68sm664!App";
                annotation.ProviderProperties.Add("ContactPanelAppID", appId);
                annotation.SupportedOperations = ContactAnnotationOperations.ContactProfile;

                // Save annotation to contact annotation list
                // Windows.ApplicationModel.Contacts.ContactAnnotationList
                var annotationList = await GetContactAnnotationList();

                await annotationList.TrySaveAnnotationAsync(annotation);
            }

            // Pin the contact to the taskbar.
            if (!await pinnedContactManager.RequestPinContactAsync(contact, PinnedContactSurface.Taskbar))
            {
                // Contact was not pinned.
                return;
            }
        }
Ejemplo n.º 37
0
 public bool oncollide(Geom geom1, Geom geom2, ContactList contactlist)
 {
     //remove itself
     master.remove(this.id);
     return false;
 }
Ejemplo n.º 38
0
        protected internal void SetCircleInfo(CircleInverseInfoType circleInfo, ContactType me)
        {
            MeContact = me;
            CID = me.contactInfo.CID;

            this.circleInfo = circleInfo;

            HostDomain = circleInfo.Content.Info.HostedDomain.ToLowerInvariant();
            CircleRole = circleInfo.PersonalInfo.MembershipInfo.CirclePersonalMembership.Role;

            SetName(circleInfo.Content.Info.DisplayName);
            SetNickName(Name);

            contactList = new ContactList(AddressBookId, new Owner(AddressBookId, me.contactInfo.passportName, me.contactInfo.CID, NSMessageHandler), this, NSMessageHandler);
            Lists = RoleLists.Allow | RoleLists.Forward;
        }
Ejemplo n.º 39
0
        bool HandleCollision(Geom geom1, Geom geom2, ContactList list)
        {
            Geom other;
            if (geom1 == this.Geometry)
            {
                other = geom2;
            }
            else
            {
                other = geom1;
            }

            BaseGameObject tag = other.Tag as BaseGameObject;
            if (tag == null)
            {
                this.Geometry.Body.Dispose();
                this.Geometry.Dispose();
                return true;
            }

            if (tag is Vehicle)
            {
                this.HitVehicle((Vehicle)tag);
            }

            if (tag is Projectile)
            {
                System.Diagnostics.Debug.WriteLine("lkjsdf");
            }

            this.Geometry.Body.Dispose();
            this.Geometry.Dispose();

            if (this.Exploded != null)
            {
                this.Exploded(this, new ProjectileExplodedEventArgs(this, tag));
            }

            return true;
        }
Ejemplo n.º 40
0
 public bool Collides(Vector2 position, Body otherBody, Vector2 otherPosition, out ContactList contacts)
 {
     return(Physics.Instance.Collides(Shape, position, otherBody.Shape, otherPosition, out contacts));
 }
Ejemplo n.º 41
0
 private bool IsListReady(ContactList xaList)
 {
     return(_listManager.FindById(xaList.Id) != null && !_listManager.IsLocked(xaList) && !_listManager.IsInUse(xaList));
 }
Ejemplo n.º 42
0
        public bool OnCollision(Geom g1, Geom g2, ContactList contactList)
        {
            Sprite s1 = (Sprite)g1.Tag;
            Sprite s2 = (Sprite)g2.Tag;

            if (g1.Tag.GetType() == typeof(Player) && (g2.Tag.GetType() == typeof(Sprite) || g2.Tag.GetType() == typeof(QuarkPlatform)))
            {
                foreach (MovingPlatform m in movingPlatforms)
                {                                 //this is to detatch the player if he crashes into a tile
                    if (m.attachedPlayer != null)
                    {
                        m.dettachPlayer();
                        playerSprite.CanJump = true;

                    }
                }
            }
            if (g2.Tag.GetType() == typeof(Pickup))
            {
                s2.Body.Dispose();
                g2.Dispose();               //pickup should be destroyed disapear and increase energy
                quarkEnergy = gameParam.PickupEnergy + quarkEnergy;
            }

            if (g2.Tag.GetType() == typeof(MovingPlatform))
            {
               //attaches player to platform via a join to stop player sliding
               MovingPlatform platform = (MovingPlatform)s2;
               platform.attachPlayer(playerSprite);
            }

            if (g2.Tag.GetType() == typeof(BouncyTile))
            {
                Cue cue = soundBank.GetCue("Bouncing platform"); //sound should play when player bounces
                cue.Play();

                int maxBounceHeight = 10000; //so if the player lands on multiple bounce tiles at once,
                                             //the force doesnt accumulate

                //code below to set bounce height

                if (playerSprite.Body.LinearVelocity.Y < 0)
                {
                    playerSprite.Body.ApplyImpulse(new Vector2(0, maxBounceHeight));
                }

                if (playerSprite.Body.LinearVelocity.Y > 0)
                {
                    playerSprite.Body.ApplyImpulse(new Vector2(0, -maxBounceHeight));
                }

                playerSprite.Body.LinearVelocity.Y = 0; // this line is incase the sprite hits more than one tile
            }

            if (g1.Tag.GetType() == typeof(Player) && (g2.Tag.GetType() == typeof(Sprite) || g2.Tag.GetType() == typeof(QuarkPlatform) || g2.Tag.GetType() == typeof(MovingPlatform)))
            {
                TicksCollision = Ticks;
                playerSprite.CanJump = true;

            }

            //collision for teleport
            if (g2.Tag.GetType() == typeof(Teleport))
            {
                Cue cue = soundBank.GetCue("Teleport");
                cue.Play();

                if (HasTeleport == true)
                {
                    //transport player to other portal
                    playerSprite.Body.Position = place.Position;
                    HasTeleport = false;
                }

                return false;
            }
            return true;
        }
Ejemplo n.º 43
0
 internal abstract void Store(ContactList list, object descriptor);
Ejemplo n.º 44
0
        public static async Task <Contact> AddOrUpdateContactAsync(DiscordRelationship relationship, ContactList list = null, ContactAnnotationList annotationList = null, StorageFolder folder = null)
        {
            if (list == null)
            {
                var store = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AppContactsReadWrite); // requests contact permissions

                var lists = await store.FindContactListsAsync();

                list = lists.FirstOrDefault(l => l.DisplayName == CONTACT_LIST_NAME) ?? (await store.CreateContactListAsync(CONTACT_LIST_NAME));
            }

            if (annotationList == null)
            {
                var annotationStore = await ContactManager.RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType.AppAnnotationsReadWrite);

                annotationList = await Tools.GetAnnotationListAsync(annotationStore);
            }

            folder = folder ?? await ApplicationData.Current.LocalFolder.CreateFolderAsync("AvatarCache", CreationCollisionOption.OpenIfExists);

            Contact contact;

            if ((contact = await list.GetContactFromRemoteIdAsync(string.Format(REMOTE_ID_FORMAT, relationship.User.Id))) == null)
            {
                Logger.Log($"Creating new contact for user {relationship.User}");
                contact = new Contact {
                    RemoteId = string.Format(REMOTE_ID_FORMAT, relationship.User.Id)
                };
            }

            if (contact.Name != relationship.User.Username)
            {
                Logger.Log($"Updating contact username for {relationship.User}");
                contact.Name = relationship.User.Username;
            }

            var currentHash = App.LocalSettings.Read <string>("ContactAvatarHashes", relationship.User.Id.ToString(), null);

            if (currentHash == null || relationship.User.AvatarHash != currentHash)
            {
                Logger.Log($"Updating contact avatar for {relationship.User}");
                contact.SourceDisplayPicture = await GetAvatarReferenceAsync(relationship.User, folder);
            }

            await list.SaveContactAsync(contact);

            var annotations = await annotationList.FindAnnotationsByRemoteIdAsync(contact.RemoteId);

            if (!annotations.Any())
            {
                Logger.Log($"Creating new contact annotation for user {relationship.User}");

                var annotation = new ContactAnnotation()
                {
                    ContactId           = contact.Id,
                    RemoteId            = string.Format(REMOTE_ID_FORMAT, relationship.User.Id),
                    SupportedOperations = ContactAnnotationOperations.Share | ContactAnnotationOperations.AudioCall | ContactAnnotationOperations.Message | ContactAnnotationOperations.ContactProfile | ContactAnnotationOperations.SocialFeeds | ContactAnnotationOperations.VideoCall,
                    ProviderProperties  = { ["ContactPanelAppID"] = APP_ID, ["ContactShareAppID"] = APP_ID }
                };

                await annotationList.TrySaveAnnotationAsync(annotation);
            }

            return(contact);
        }
 /// <summary>
 /// Get the Atom entry for newly Contact List to be send to Constant server
 /// </summary>
 /// <param name="list">Contact List to be created</param>
 /// <returns>Atom entry used to create new Contact List</returns>
 public static StringBuilder CreateNewContactList(ContactList list)
 {
     return(CreateAtomEntry(list));
 }
Ejemplo n.º 46
0
 public void orderContactList()
 {
     ContactList = ContactList.OrderBy(o => o.Name).OrderBy(o => o.Status).ToList();
 }
Ejemplo n.º 47
0
        /// <summary>
        /// To make this class a singleton
        /// </summary>
        public AppController()
        {
            m_hiddenWnd = new HiddenWindow();
            m_hiddenWnd.Visible = false;
            MainForm = m_hiddenWnd;

            m_hiddenWnd.Load += new EventHandler(HiddenWnd_load);
            m_contacts = new ContactList();
            m_ActiveChatUsers = new Hashtable();
        }
Ejemplo n.º 48
0
 public Messenger()
 {
     this.messengerServer = IPAddress.Parse("64.4.13.17");
       this.lastContactSynced = null;
       this.syncContactsCount = 0;
       this.networkConnected = false;
       this.InitialStatus = MSNStatus.Online;
       this.log = new ArrayList();
       this.conversationQueue = new Queue();
       this.conversationList = new ArrayList();
       this.contacts = new Messenger.ContactList();
       this.contactGroups = new Hashtable();
       this.currentTransaction = 0;
       this.TextEncoding = new UTF8Encoding();
       this.socketBuffer = new byte[0x8000];
       this.synSended = false;
       this.totalMessage = "";
       IPHostEntry entry1 = Dns.Resolve("messenger.hotmail.com");
       IPAddress address1 = entry1.AddressList[0];
       this.MessengerServer = address1;
 }
Ejemplo n.º 49
0
 public List <Wrestler> getWrestlerList(Wrestler._status status)
 {
     return(ContactList.Where(w => w.Status == status && !w.isSelected).ToList().OrderBy(w => w.Name).ToList());
 }
Ejemplo n.º 50
0
 private bool OnCollision(Geom geom1, Geom geom2, ContactList contactList)
 {
     return true;
 }
Ejemplo n.º 51
0
 public void ToSoodaObjectList()
 {
     using (new SoodaTransaction())
     {
         ContactList cl = new ContactList(Contact.Linq().ToSoodaObjectList());
         Assert.AreEqual(7, cl.Count);
         CollectionAssert.Contains(cl, Contact.Mary);
     }
 }
Ejemplo n.º 52
0
        public ContactList Update(int contactListId, ContactList contactList)
        {
            int accountId = contactList.Id > 0 ? contactList.Id : CurrentAccount;

            return(Update(accountId, contactListId, contactList));
        }
 // GET: ContactLists
 public ActionResult Index()
 {
     //return View(db.ContactLists.ToList());
     return(View(ContactList.find_all()));
 }
Ejemplo n.º 54
0
        protected void btnAddLead_Click(object sender, EventArgs e)
        {
            LeadData lead = new LeadData();

            lead.BusinessName      = txtBusinessName.Text;
            lead.ComplianceAgent   = txtComplianceAgent.Text;
            lead.ContactName       = txtContactName.Text;
            lead.DOTNo             = txtDoT.Text;
            lead.Email             = txtEmail.Text;
            lead.Notes             = txtNotes.Text;
            lead.PhoneNoForContact = txtBestPhone.Text;
            lead.SalesPersonID     = Convert.ToInt32(Request.Cookies["UserID"].Value);
            lead.ServiceDiscussed  = txtServiceDiscussed.Text;
            lead.TimeLine          = txtTimeLine.Text;

            bool isLeadAdded = leadHelper.AddLead(lead);

            IUserServiceContext    userServiceContext = new UserServiceContext(_accessToken, _apiKey);
            ConstantContactFactory serviceFactory     = new ConstantContactFactory(userServiceContext);
            //List<string> lists = new List<string>() { "1236366064" };

            List <string> lists = new List <string>();

            string[] emailid = hdnEmailID.Value.Split(',');
            foreach (string item in emailid)
            {
                if (!String.IsNullOrEmpty(item))
                {
                    lists.Add(item);
                }
            }
            List <ContactList> contactLists = new List <ContactList>();

            foreach (string list in lists)
            {
                ContactList contactList = new ContactList()
                {
                    Id = list
                };
                contactLists.Add(contactList);
            }
            if (isLeadAdded)
            {
                int             leadID         = Convert.ToInt32(Request.QueryString["LeadID"]);
                DailyLeadEntity dailyLead      = dailyLeadHelper.GetLeadRecordsByLeadID(leadID);
                var             contactService = serviceFactory.CreateContactService();
                string          physicalCity   = "";
                try
                {
                    physicalCity = dailyLead.PhysicalAddress.Split(',')[1].Split(null)[1];
                }
                catch
                {
                }
                Address address = new Address();
                try
                {
                    address = new Address()
                    {
                        AddressType = "BUSINESS",
                        City        = toString(physicalCity),
                        CountryCode = "US",
                        Line1       = toString(dailyLead.MailingAddress.Substring(0, 40)),
                        Line2       = toString(dailyLead.MailingAddress.Substring(0, 40)),
                        PostalCode  = toString(dailyLead.ZipCode),
                        StateCode   = toString("ID"),
                    };
                }
                catch
                {
                    address = new Address()
                    {
                        AddressType = "BUSINESS"
                    };
                }

                try
                {
                    if (dailyLead != null)
                    {
                        Contact contact = new Contact()
                        {
                            Addresses = new List <Address> {
                                address
                            },
                            Lists          = contactLists,
                            CellPhone      = dailyLead.PhoneNo,
                            CompanyName    = toString(dailyLead.LegalName),
                            Confirmed      = true,
                            EmailAddresses = new List <EmailAddress> {
                                new EmailAddress(toString(txtEmail.Text))
                            },
                            Fax        = dailyLead.PhoneNo,
                            FirstName  = txtContactName.Text,
                            HomePhone  = txtBestPhone.Text,
                            JobTitle   = "Purcell Compliance Lead",
                            LastName   = toString(""),
                            PrefixName = "Mr.",
                            WorkPhone  = dailyLead.PhoneNo
                        };
                        contactService.AddContact(contact, false);
                    }
                    else
                    {
                        Contact contact = new Contact()
                        {
                            Addresses = new List <Address> {
                                address
                            },
                            Lists          = contactLists,
                            CellPhone      = txtBestPhone.Text,
                            CompanyName    = toString(txtBusinessName.Text),
                            Confirmed      = true,
                            EmailAddresses = new List <EmailAddress> {
                                new EmailAddress(toString(txtEmail.Text))
                            },
                            Fax        = txtBestPhone.Text,
                            FirstName  = txtContactName.Text,
                            HomePhone  = txtBestPhone.Text,
                            JobTitle   = "Purcell Compliance Lead",
                            LastName   = toString(""),
                            PrefixName = "Mr.",
                            WorkPhone  = txtBestPhone.Text
                        };
                        contactService.AddContact(contact, false);
                    }
                    Response.Write("<script>alert('Lead added Successfully.');</script>");
                    resetControls();
                }
                catch
                {
                    //Response.Write("<script>alert('" + ex.Message + "');</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('Some error occured.');</script>");
            }
        }
Ejemplo n.º 55
0
 public bool LoadContactList()
 {
     ContactList = Logic.LoadContactList();
     FillContactListbox();
     SelectContact(-1);
     return false;
 }
Ejemplo n.º 56
0
        public void ToSoodaObjectListArray()
        {
            ContactList cl = new ContactList(new Contact[0].ToSoodaObjectList());
            Assert.AreEqual(0, cl.Count);

            using (new SoodaTransaction())
            {
                Contact[] a = new Contact[] { Contact.Mary, Contact.Ed };
                cl = new ContactList(a.ToSoodaObjectList());
                Assert.AreEqual(2, cl.Count);
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Ed }, cl);

                // array should have been copied
                a[1] = Contact.Mary;
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Ed }, cl);

                // should not affect the array
                cl.Add(Contact.Eva);
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Ed, Contact.Eva }, cl);
                CollectionAssert.AreEqual(new Contact[] { Contact.Mary, Contact.Mary }, a);
            }
        }
Ejemplo n.º 57
0
 public bool Collides(Body otherBody, out ContactList contacts)
 {
     return(Physics.Instance.Collides(Shape, Position, otherBody.Shape, otherBody.Position, out contacts));
 }
Ejemplo n.º 58
0
 public void NewContactList()
 {
     FileName = null;
     ContactList = Logic.CreateContactList();
     FillContactListbox();
     SelectContact(-1);
 }
Ejemplo n.º 59
0
 public bool Collides(out ContactList contacts)
 {
     return(Collides(Position, out contacts));
 }
Ejemplo n.º 60
0
        protected void fillClaimStatusReview(int clientd)
        {
            ClaimManager objClaimManager = new ClaimManager();

            List<Carrier> objCarrier = new List<Carrier>();
            objCarrier = objClaimManager.GetAllCarrier(clientd);

            List<ContactList> objContactlist = new List<ContactList>();

            List<Contact> listContact = ContactManager.GetAll(clientd).ToList();

            List<StatusMaster> statusMasters = null;

            List<ExpenseType> expenseTypes = null;

            ContactList objcontact1;
            foreach (Contact data in listContact)
            {
                objcontact1 = new ContactList();
                objcontact1.ContactID = data.ContactID;
                objcontact1.FirstName = data.FirstName;
                objcontact1.LastName = data.LastName;
                objcontact1.Email = data.Email;
                objcontact1.CompanyName = data.CompanyName;
                objcontact1.IdOf = "c";
                objContactlist.Add(objcontact1);
            }
            List<AdjusterMaster> listAdjuster = CRM.Data.Account.AdjusterManager.GetAll(clientd).ToList();
            foreach (AdjusterMaster data in listAdjuster)
            {
                objcontact1 = new ContactList();
                objcontact1.ContactID = data.AdjusterId;
                objcontact1.FirstName = data.FirstName;
                objcontact1.LastName = data.LastName;
                objcontact1.Email = data.email;
                objcontact1.CompanyName = data.CompanyName;
                objcontact1.IdOf = "a";
                objContactlist.Add(objcontact1);
            }
            gvSelectRecipients.DataSource = objContactlist.AsQueryable();
            gvSelectRecipients.DataBind();

            gvSelectRecipientsStatus.DataSource = objContactlist.AsQueryable();
            gvSelectRecipientsStatus.DataBind();

            gvSelectRecipientsExpense.DataSource = objContactlist.AsQueryable();
            gvSelectRecipientsExpense.DataBind();

            statusMasters = StatusManager.GetList(clientd);
            if (statusMasters!=null)
            {
            CollectionManager.FillCollection(ddlClaimStatusReview, "StatusId", "StatusName", statusMasters);
            }
            if (objCarrier!=null)
            {
            CollectionManager.FillCollection(ddlClaimCarrier, "CarrierID", "CarrierName", objCarrier);
            CollectionManager.FillCollection(ddlExpenseClaimCarrier, "CarrierID", "CarrierName", objCarrier);
            }

            Client objClient = ClaimsManager.GetClientByUserId(SessionHelper.getUserId());
            if (objClient!=null)
            {
                txtAdjusterComapnyName.Text = objClient.BusinessName;
                txtExpenseAdjusterComapnyName.Text = objClient.BusinessName;
            }

            using (ExpenseTypeManager repository = new ExpenseTypeManager())
            {
                expenseTypes = repository.GetAll(clientd).ToList();
            }
            if (expenseTypes!=null)
            {
            Core.CollectionManager.FillCollection(ddlExpenseType, "ExpenseTypeID", "ExpenseName", expenseTypes);
            }
        }