Inheritance: System.Web.UI.Page
Exemple #1
0
 // AddDecoyContact                                                                       //
 // Sets the decoy segments of the input vector based on passed position and contact type //
 public void AddDecoyContact( Vector3 decoyPosition, ContactType decoyContactType )
 {
     switch( decoyContactType ) {
         case ContactType.VISUAL: {
             mInputVector[ mDecoyVisualX ] = decoyPosition.x;
             mInputVector[ mDecoyVisualY ] = decoyPosition.y;
             mInputVector[ mDecoyVisualZ ] = decoyPosition.z;
             break;
         }
         case ContactType.AUDIO:{
             mInputVector[ mDecoyAudioX ] = decoyPosition.x;
             mInputVector[ mDecoyAudioY ] = decoyPosition.y;
             mInputVector[ mDecoyAudioZ ] = decoyPosition.z;
             break;
         }
         case ContactType.VISUAL_AND_AUDIO: {
             mInputVector[ mDecoyVisualX ] = decoyPosition.x;
             mInputVector[ mDecoyVisualY ] = decoyPosition.y;
             mInputVector[ mDecoyVisualZ ] = decoyPosition.z;
             mInputVector[ mDecoyAudioX ]  = decoyPosition.x;
             mInputVector[ mDecoyAudioY ]  = decoyPosition.y;
             mInputVector[ mDecoyAudioZ ]  = decoyPosition.z;
             break;
         }
     }
 }
 /// <summary>
 /// Gets the list of config parameters that are related to business rules governing ui interaction for ranking
 /// </summary>
 /// <returns>List of ConfigParameter objects</returns>
 public static IList<ConfigParameter> GetBusinessRulesConfigParametersFor(ContactType cType)
 {
     string[] projectConfigParams=null;
     switch (cType)
     {
         case ContactType.Project:
             projectConfigParams= new string[]{
             ConfigEnum.EnforceContinuousStudentRanking.ToString(),ConfigEnum.MaxRejectedBusStudents.ToString(),ConfigEnum.MaxRejectedEngStudents.ToString(),ConfigEnum.MaxRejectedStudents.ToString(),ConfigEnum.MinABusStudents.ToString(),ConfigEnum.MinAEngStudents.ToString(),ConfigEnum.MinAStudents.ToString(),ConfigEnum.MinBBusStudents.ToString(),ConfigEnum.MinBEngStudents.ToString(),ConfigEnum.MinBStudents.ToString(),ConfigEnum.RejectedStudentThreshold.ToString()
             };
             break;
         case ContactType.Student:
             projectConfigParams= new string[]{
             ConfigEnum.EnforceContinuousProjectRanking.ToString(),ConfigEnum.MaxRejectedProjects.ToString(),ConfigEnum.RejectedProjectThreshold.ToString(), ConfigEnum.MinFirstProjects.ToString()
             };
             break;
         default:
             break;
     }
     IList<ConfigParameter> uiParams;
     using (MatchingDB db = new MatchingDB())
     {
         if (projectConfigParams != null)
             uiParams = db.ConfigParameters.Where(c => projectConfigParams.Contains(c.Name)).ToList();
         else
             uiParams = db.ConfigParameters.ToList();
     }
     return uiParams;
 }
Exemple #3
0
 public Email(string emailAddress, ContactType type, int index)
 {
     listeners = new List<ContactValueChangedListener>();
     EmailAddress = emailAddress;
     Type = type;
     Index = index;
 }
Exemple #4
0
 public Number(string phoneNumber, ContactType type, int index)
 {
     listeners = new List<ContactValueChangedListener>();
     PhoneNumber = phoneNumber;
     Type = type;
     Index = index;
 }
Exemple #5
0
 public BWeapon(int amount, WeapType wt,WeapRanType wrt, ContactType ctype)
     : base()
 {
     //this.master = (BWarship)node;
     this.ctype = ctype;
     this.Amount =amount;
     this.WeaponRangeType = wrt;
     this.WeaponType = wt;
 }
Exemple #6
0
 /// <summary>
 /// Construct a new WiiContact.
 /// </summary>
 /// <param name="iID">The unique session ID for this input.</param>
 /// <param name="eContactType">The type of contact.</param>
 /// <param name="tPosition">The position which generated the contact.</param>
 /// <param name="tNormalPosition">The maximum width/height so that we can generate a normalised position.</param>
 /// <param name="pClassifier">The classifer responsible for the history</param>
 /// <param name="pTracker">The tracker within the classifer responsible for the direct history.</param>
 public WiiContact(ulong iID, ContactType eContactType, Point tPosition, int priority, Vector tScreenSize)
 {
     this.ID = iID;
     this.Type = eContactType;
     this.Position = tPosition;
     this.Priority = priority;
     this.NormalPosition = new Point(tPosition.X / tScreenSize.X, tPosition.Y / tScreenSize.Y);
     this.Size = new Vector(0, 0);
 }
 public BDefenseCannon(int amount, WeapType wt,WeapRanType wrt, ContactType ctype, float shootcd)
     : base(amount,wt,wrt ,ctype)
 {
     //数据设置
     width =5;
     height = 5;
     speed = 8f;
     Att = 2f;
     shootCd =new Countdown(shootcd);
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 public OTA_HotelResCallEntity()
     : base("OTA_HotelRes")
 {
     this.TimeStamp = DateTime.Now;
     this.personList = new List<string>();
     this.phoneTechType = PhoneTechnologyType.Mobile;
     this.specialDescription = new List<string>();
     this.currencyCode = "CNY";
     this.contactType = Enums.ContactType.sms;
 }
        public ActionResult Create(ContactType contacttype)
        {
            if (ModelState.IsValid)
            {
                db.ContactTypes.Add(contacttype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(contacttype);
        }
 public void DeleteType(int id = 0)
 {
     try {
         ContactType type = new ContactType { ID = id };
         type.Delete();
     } catch (Exception e) {
         Response.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError;
         Response.StatusDescription = e.Message;
         Response.Write(e.Message);
     }
 }
 public BGeneralBomb(int amount, WeapType wt,WeapRanType wrt,ContactType ctype, float shootcd)
     : base(amount,wt,wrt,ctype)
 {
     //数据设置
     width =12;
     height = 12;
     speed =4.6f;
     startBomb = 0.1f;
     Att = 0.5f;
     shootCd = new Countdown(shootcd);
 }
Exemple #12
0
		public Contact(Character attacker, Character target, HitDefinition hitdef, ContactType type)
		{
			if (attacker == null) throw new ArgumentNullException("attacker");
			if (target == null) throw new ArgumentNullException("target");
			if (hitdef == null) throw new ArgumentNullException("hitdef");
			if (type == ContactType.None) throw new ArgumentOutOfRangeException("type");

			m_attacker = attacker;
			m_target = target;
			m_hitdef = hitdef;
			m_type = type;
		}
        public static ContactManagerBase CreateContactManager(ContactType type)
        {
            ContactManagerBase mgr = null;
              switch (type)
              {
            case(ContactType.Outlook):
              mgr = new OutlookContactManager();
              break;
              }

              return mgr;
        }
 public string AddType(string label = "", string email = "") {
     try {
         ContactType type = new ContactType {
             label = label,
             email = email
         };
         type.Add();
         return JsonConvert.SerializeObject(type);
     } catch (Exception e) {
         return e.Message;
     }
 }
        // PUT api/awbuildversion/5
        public void Put(ContactType value)
        {
            var GetActionType = Request.Headers.Where(x => x.Key.Equals("ActionType")).FirstOrDefault();

            if (GetActionType.Key != null)
            {
                if (GetActionType.Value.ToList()[0].Equals("DELETE"))
                    adventureWorks_BC.ContactTypeDelete(value);
                if (GetActionType.Value.ToList()[0].Equals("UPDATE"))
                    adventureWorks_BC.ContactTypeUpdate(value);
            }
        }
Exemple #16
0
 public BBullet(Node node,Vector2 pos,Vector2 Dir,float Speed,
     float w, float h,WeapRanType wrt, ContactType ctype,float att, string path)
     : base(node,0,0,pos,w,h,ctype,null,null)
 {
     this.Att =att;
     this. Speed = Speed;
     this.Dir = Dir;
     body =new SpriteX(path,pos);
     body.ChangeFather(this);
     body.CenterSprite(TRS.Local.Center);
     body.Color = new Vector4(12/255f,255/255f,98/255f,255f/255f);
     maxShootDis = BWeapon.GetRangeByType(wrt);
 }
Exemple #17
0
        /// <summary>
        /// 构造一个宇宙舰基对象,会碰撞的
        /// </summary>
        public BWarship(Node node,Vector2 pos,float width,float height,
            ContactType ctype,ContactDeal td,ContactDeal bd,string path)
            : base(node,0,0,pos,width,height,ctype,td,bd)
        {
            body = new SpriteX(this,path,pos);
            body.CenterSprite(TRS.Local.Center);
            HP = 100;

                Speed=8f;
                MaxRotSpeed = 0.02f;
                RotSpeed =MaxRotSpeed;
                RotSpeedInc = 0.002f;
            this.Body.Scale = allWarshipScale;
        }
        public static string GetBusinessRulesConfigParametersAsJSVariableStatementFor(ContactType cType)
        {
            StringBuilder jsVariables = new StringBuilder();

            #region Build js statements to set js variable that keep ui business rules parameters.
            String jsConfigVarTemplate = "var {0} = {1};";
            IList<ConfigParameter> uiRules = ConfigurationService.GetBusinessRulesConfigParametersFor(cType);
            foreach (ConfigParameter param in uiRules)
            {
                jsVariables.AppendFormat(jsConfigVarTemplate, param.Name, param.JsValue).AppendLine();
            }
            #endregion
            return jsVariables.ToString();
        }
Exemple #19
0
        /// <summary>
        /// Constructor from the API.
        /// </summary>
        /// <param name="src"></param>
        internal Contact(SerializableContactListItem src)
        {
            m_contactID = src.ContactID;
            Name = src.ContactName;
            IsInWatchlist = src.InWatchlist;
            Standing = src.Standing;
            Group = src.Group == ContactGroup.Personal && StaticGeography.AllAgents.Any(x => x.ID == m_contactID)
                ? ContactGroup.Agent
                : src.Group;

            m_contactType = src.ContactTypeID == DBConstants.CorporationID
                ? m_contactType = ContactType.Corporation
                : src.ContactTypeID == DBConstants.AllianceID
                    ? m_contactType = ContactType.Alliance
                    : ContactType.Character;
        }
 /// <summary>Converts POC property to textual representation</summary>
 /// <param name="type">POC object property</param>
 /// <returns>Textual representation</returns>
 private static string ConvertTypeToText(ContactType? type)
 {
     if (type == null) return string.Empty;
     switch (type.Value)
     {
         case ContactType.MobilePhoneLocal: return "Мобильный телефон (РФ)";
         case ContactType.MobilePhoneInternational: return "Мобильный телефон (вне РФ)";
         case ContactType.HomePhone: return "Домашний телефон";
         case ContactType.WorkingPhone: return "Рабочий телефон";
         case ContactType.PostAddress: return "Почтовый адрес";
         case ContactType.Fax: return "Факс";
         case ContactType.Email: return "E-mail";
         case ContactType.Phone: return "Телефон";
         case ContactType.Comment: return "Примечание";
         default: throw new Exception("Unknown Contact Type option");
     }
 }
        public BDoubleMissile(int amount, WeapType wt,WeapRanType wrt,ContactType ctype, float shootcd)
            : base(amount,wt,wrt,ctype)
        {
            //数据设置
            width =8;
            height = 8;
            speed = 3.8f;
            Att = 5f;

            rots=0.08f;
            rotsInc = 0.0003f;
            speed =6f;

            shootCd = new Countdown(shootcd);
            //一次的发射数量
            OnceAmount = 2;
        }
Exemple #22
0
        public BBomb(Node node, Vector2 pos, Vector2 Dir, float Speed,
            float w, float h, WeapRanType wrt,float startBomb,  float NoContactTime,ContactType ctype, float att, string path)
            : base(node,0,0,pos,w,h,ctype,null,null)
        {
            this.Att =att;

            this.NoContactTime = NoContactTime;
            this. Speed = Speed;
            this.Dir = Dir;
            body =new SpriteX(path,pos);
            body.ChangeFather(this);
            body.CenterSprite (TRS.Local.Center);

            //
            body.Scale = new Vector2 (12f, 12f);
            body.Color = new Vector4(220/255f,82/255f,98/255f,255f/255f);
            //base.drawBoundBox = new DrawBoundBox(this);
        }
Exemple #23
0
        public BMissile(Node node,Vector2 pos,BWarship target,float Speed,float rots,float rotsInc,
            float w, float h, WeapRanType wrt, ContactType ctype,float att, string path)
            : base(node,0,0,pos,w,h,ctype,null,null)
        {
            this.Att =att;
            this. Speed = Speed;
            this.target = target;

            body = new SpriteX(path,pos);
            body.ChangeFather(this);
            body.CenterSprite(TRS.Local.Center);
            body.Scale = new Vector2(0.4f,0.4f);

            tracker =new BTracker(body,ref this.Speed,rots,rotsInc);
            tracker.SetTarger(target.GetPosition());

            body.Color = BWarship.ColorID;
            maxShootDis = BWeapon.GetRangeByType(wrt);
        }
Exemple #24
0
 public Contact(int contact_id, int entity_id, int contact_type_id, 
             string free_text, string addr_line1, string addr_line2, int address_channel_id, int suburb_id, int country_id,
             int site_id, bool is_billing, bool is_non_billing,
             DateTime contact_date_added, DateTime contact_date_modified)
 {
     this.contact_id         = contact_id;
     this.entity_id          = entity_id;
     this.contact_type       = new ContactType(contact_type_id);
     this.free_text          = free_text;
     this.addr_line1         = addr_line1;
     this.addr_line2         = addr_line2;
     this.address_channel    = address_channel_id == -1 ? null : new AddressChannel(address_channel_id);
     this.suburb             = suburb_id          == -1 ? null : new Suburb(suburb_id);
     this.country            = country_id         == -1 ? null : new IDandDescr(country_id);
     this.site               = site_id            == -1 ? null : new Site(site_id);
     this.is_billing         = is_billing;
     this.is_non_billing     = is_non_billing;
     this.contact_date_added = contact_date_added;
     this.contact_date_modified = contact_date_modified;
 }
Exemple #25
0
        /// <summary>
        /// This constructor is used when we have just the name
        /// </summary>
        public Contact(ContactType type, string name, string alias, string address, string domain, bool isInternal)
        {
            if (address == null)
            {
				System.Diagnostics.Trace.WriteLine( Workshare.Reports.Properties.Resources.TRACE_NULL, "Contact" );
				throw ( new ArgumentNullException( "name", Workshare.Reports.Properties.Resources.TRACE_NULL ) );
			}

            m_name = name;
            m_alias = alias;
            m_address = address;
            m_domain = domain;
            m_isInternal = isInternal;
            m_type = type;
            if (m_name == null)
                m_name = "";
            if (m_domain == null)
                m_domain = "";
            if (m_alias == null)
                m_alias = "";
        }
Exemple #26
0
        /// <summary>
        /// 创建一个活体,带有碰撞检测
        /// </summary>
        public LiveObject(Node node,float CreatTime,float DieTime,
            Vector2 center, float width,float height,ContactType ctype,
            ContactDeal td,ContactDeal bd)
            : base(node)
        {
            //drawBoundBox = new DrawBoundBox(this);

            this.toContactDeal = td;
            this.beContactDeal = bd;

            this.Width = width;
            this.Heigth = height;
            this.Center = new Vector2(center.X,-center.Y);
            this.CType = ctype;

            Sce.Pss.HighLevel.GameEngine2D.Scheduler.Instance.Schedule(this, Tick, 0.0f, false);
            this.GodTimer = CreatTime;
            this.DieTime = DieTime;
            this.Born();
            //this.ContactDate = new List<Contacter.Contact>();//碰撞资料
            this.status = ObjectStatus.God;
        }
        public virtual void OnContact(IContactTrigger otherCT, ContactType contactType)
        {
            if (GetComponent <ContactProjectile>() && contactType == ContactType.Enter)
            {
                Debug.Log("Prj Contact");
            }



            /// Check each system that is part of this contact event, to see if what it contacted with is applicable
            List <IContactSystem> systems = otherCT.Proxy.ContactSystems;

            int systemsCount = systems.Count;

            if (systemsCount == 0)
            {
                return;
            }

            /// May be important in preventing race conditions when objects first spawn in, where they might trigger contacts by starting in the wrong state.
            if (netObj != null && !this._proxy.NetObj.AllObjsAreReady)
            {
                //Debug.LogError(Time.time + name + " " + _proxy.NetObj.photonView.OwnerActorNr + " Not ready so ignoring contact");
                return;
            }

            var otherNetObj = otherCT.Proxy.NetObj;

            if (otherNetObj != null && !otherNetObj.AllObjsAreReady)
            {
                Debug.Log(Time.time + name + " " + otherNetObj.photonView.OwnerActorNr + " Other object not ready so ignoring contact");
                return;
            }

            for (int i = 0; i < systemsCount; i++)
            {
                var system = systems[i];

                if (!IsCompatibleSystem(system, otherCT))
                {
                    continue;
                }

                //Debug.Log(name + " " + GetType().Name + " <> " + ics.GetType().Name + " <b>PASSED</b>");
                /// Check to see if we have already reacted to this collision (multiple colliders/etc)
                if (preventRepeats)
                {
                    switch (contactType)
                    {
                    case ContactType.Enter:
                    {
                        if (triggeringEnters.Contains(system))
                        {
                            continue;
                        }

                        triggeringEnters.Add(system);
                        break;
                    }

                    case ContactType.Stay:
                    {
                        if (triggeringStays.Contains(system))
                        {
                            continue;
                        }

                        triggeringStays.Add(system);
                        break;
                    }

                    case ContactType.Exit:
                    {
                        if (!triggeringEnters.Contains(system))
                        {
                            continue;
                        }

                        triggeringEnters.Remove(system);
                        break;
                    }

                    case ContactType.Hitscan:
                    {
                        if (triggeringHitscans.Contains(system))
                        {
                            continue;
                        }

                        triggeringHitscans.Add(system);
                        break;
                    }
                    }
                }

                //Debug.Log("Other " + (otherCT as Component).name + " : " + (otherCT as Component).GetType().Name);

                /// Ignore contact types we have no reactors for. This runs after the above loop, because Enter/Stay/Exit all need to be processed for PreventRepeats to work.
                if ((usedContactTypes & contactType) == 0)
                {
                    return;
                }

                /// If there is an ISyncContact, pass contactEvents to it rather than executing them.
                var contactEvent = new ContactEvent(system, otherCT, contactType);

                if (ReferenceEquals(Proxy.SyncContact, null))
                {
                    ContactCallbacks(contactEvent);
                }
                else
                {
                    syncContact.SyncContactEvent(contactEvent);
                }
            }
        }
        public ContactCardDto SaveMailContact(int tenant, string user, string name, string description,
                                              List <string> emails, List <string> phoneNumbers, ContactType type)
        {
            var data = new List <ContactInfoDto>();
            int contactId;

            using (var db = GetDb())
            {
                using (var tx = db.BeginTransaction())
                {
                    var queryContact = new SqlInsert(ContactsTable.Name, true)
                                       .InColumnValue(ContactsTable.Columns.Id, 0)
                                       .InColumnValue(ContactsTable.Columns.User, user)
                                       .InColumnValue(ContactsTable.Columns.Tenant, tenant)
                                       .InColumnValue(ContactsTable.Columns.ContactName, name)
                                       .InColumnValue(ContactsTable.Columns.Address, emails[0])
                                       .InColumnValue(ContactsTable.Columns.Description, description)
                                       .InColumnValue(ContactsTable.Columns.Type, (int)type)
                                       .InColumnValue(ContactsTable.Columns.HasPhoto, false)
                                       .Identity(0, 0, true);

                    contactId = db.ExecuteScalar <int>(queryContact);

                    for (var i = 0; i < emails.Count; i++)
                    {
                        var isPrimary = i == 0;
                        var id        = SaveContactInfo(db, tenant, user, contactId, emails[i], ContactInfoType.Email, isPrimary);
                        data.Add(new ContactInfoDto(id, tenant, user, contactId, emails[i], (int)ContactInfoType.Email, isPrimary));
                    }

                    for (var i = 0; i < phoneNumbers.Count; i++)
                    {
                        var isPrimary = i == 0;
                        var id        = SaveContactInfo(db, tenant, user, contactId, phoneNumbers[i], ContactInfoType.Phone, isPrimary);
                        data.Add(new ContactInfoDto(id, tenant, user, contactId, phoneNumbers[i], (int)ContactInfoType.Phone, isPrimary));
                    }

                    tx.Commit();
                }
            }
            return(new ContactCardDto(contactId, user, tenant, name, data, description, (int)type, false));
        }
 /// <summary>
 /// Creates a contact person object with the contact type.
 /// </summary>
 /// <param name="contactType">The <see cref="ContactType"/> for this object.</param>
 public ContactPerson(ContactType contactType)
 {
     _type = contactType;
 }
Exemple #30
0
 public Builder WithType(ContactType type)
 {
     _telegramContact.Type = type;
     return(this);
 }
Exemple #31
0
 protected void AddContactKind(StringBuilder stringBuilder, ContactType contactType)
 {
     stringBuilder.AppendLine($"KIND:{contactType.ToString()}");
 }
Exemple #32
0
        void LlenarReceptor(En_Receptor Receptor, ref CreditNoteType creditNote)
        {
            WebsiteURIType EmisorPaginaWeb = new WebsiteURIType
            {
                Value = Receptor.PaginaWeb.Trim()
            };

            List <PartyNameType> oListaNombreComercial = new List <PartyNameType>();
            PartyNameType        PartyName             = new PartyNameType
            {
                Name = new NameType1
                {
                    Value = Receptor.NombreComercial.Trim()
                }
            };

            oListaNombreComercial.Add(PartyName);


            PartyIdentificationType        EmisorIdentificacion      = new PartyIdentificationType();
            List <PartyIdentificationType> EmisorListaIdentificacion = new List <PartyIdentificationType>();

            EmisorIdentificacion.ID = new IDType
            {
                Value          = Receptor.NumeroDocumentoIdentidad.Trim(),
                schemeAgencyID = "PE:SUNAT",
                schemeID       = Receptor.TipoDocumentoIdentidad.Trim(),
                schemeName     = "Documento de Identidad",
                schemeURI      = "urn:pe:gob:sunat:cpe:see:gem:catalogos:catalogo06"
            };
            EmisorListaIdentificacion.Add(EmisorIdentificacion);

            //Razon social
            PartyLegalEntityType oRazonSocial = new PartyLegalEntityType
            {
                RegistrationName = new RegistrationNameType
                {
                    Value = Receptor.RazonSocial,
                },

                RegistrationAddress = new AddressType
                {
                    ID = new IDType
                    {
                        Value            = Receptor.CodigoUbigeo.Trim(),
                        schemeAgencyName = "PE:INEI",
                        schemeName       = "Ubigeos"
                    },
                    AddressTypeCode = new AddressTypeCodeType
                    {
                        Value          = Receptor.CodigoDomicilioFiscal.Trim(),
                        listAgencyName = "PE:SUNAT",
                        listName       = "Establecimientos anexos"
                    },
                    CitySubdivisionName = new CitySubdivisionNameType
                    {
                        Value = Receptor.Urbanizacion.Trim()
                    },
                    CityName = new CityNameType
                    {
                        Value = Receptor.Provincia.Trim()
                    },
                    CountrySubentity = new CountrySubentityType
                    {
                        Value = Receptor.Departamento.Trim()
                    },
                    District = new DistrictType
                    {
                        Value = Receptor.Distrito.Trim()
                    },
                    AddressLine = new AddressLineType[] {
                        new AddressLineType {
                            Line = new LineType {
                                Value = Receptor.Direccion.Trim()
                            }
                        }
                    },
                    Country = new CountryType
                    {
                        IdentificationCode = new IdentificationCodeType
                        {
                            listAgencyName = "United Nations Economic Commission for Europe",
                            listID         = "ISO 3166-1",
                            listName       = "Country",
                            Value          = Receptor.CodigoPais.Trim()
                        }
                    }
                }
            };

            ContactType oContacto = new ContactType
            {
                ElectronicMail = new ElectronicMailType()
                {
                    Value = Receptor.Contacto.Correo.Trim()
                },
                Name = new NameType1
                {
                    Value = Receptor.Contacto.Nombre.Trim()
                },
                Telephone = new TelephoneType
                {
                    Value = Receptor.Contacto.Telefono.Trim()
                }
            };

            CustomerPartyType oReceptor = new CustomerPartyType
            {
                Party = new PartyType
                {
                    WebsiteURI          = EmisorPaginaWeb,
                    PartyIdentification = EmisorListaIdentificacion.ToArray(),
                    PartyName           = oListaNombreComercial.ToArray(),
                    PartyLegalEntity    = new PartyLegalEntityType[] { oRazonSocial },
                    Contact             = oContacto
                }
            };

            creditNote.AccountingCustomerParty = oReceptor;
        }
        void UpdateContact(Contact contact)
        {
            // Update time-related variables
            contact.time += Time.deltaTime;

            switch (contact.type)
            {
            case ContactType.Entered:
                contact.enteredTime += Time.deltaTime;
                contact.touchedTime  = 0.0f;
                contact.graspedTime  = 0.0f;
                break;

            case ContactType.Touched:
                contact.enteredTime += Time.deltaTime;
                contact.touchedTime += Time.deltaTime;
                contact.graspedTime  = 0.0f;
                break;

            case ContactType.Grasped:
                contact.enteredTime += Time.deltaTime;
                contact.touchedTime += Time.deltaTime;
                contact.graspedTime += Time.deltaTime;
                break;

            case ContactType.None:
                break;
            }

            // Update count of special bones touching
            int specialPartsTouchingCount = 0;

            BoneModel          bone;
            BoneCollisionModel boneCollision;

            for (int b = 0; b < contact.bonesTouching.Count; b++)
            {
                boneCollision = contact.bonesTouching[b];
                bone          = boneCollision.bone;

                if (bone != null && bone.part != null && isSpeciallyInvolvedInGrasping(bone.part))
                {
                    specialPartsTouchingCount++;
                }

                // Debug
                if (model.drawContacts)
                {
                    for (int p = 0; p < boneCollision.points.Count; p++)
                    {
                        Debug.DrawLine(bone.reprs[PuppetModel.key].transformRef.position, boneCollision.points[p].point, Color.yellow);
                    }
                }
            }

            contact.specialPartsTouchingCount = specialPartsTouchingCount;

            // Update type
            ContactType previousType = contact.type;

            if (isGrasping(contact))
            {
                contact.type = ContactType.Grasped;
            }
            else if (contact.bonesTouching.Count > 0)
            {
                contact.type = ContactType.Touched;
            }
            else if (contact.bonesEntered.Count > 0)
            {
                contact.type = ContactType.Entered;
            }
            else
            {
                contact.type = ContactType.None;
            }

            // Invoke action events
            InvokeContactEvents(contact, previousType);
        }
Exemple #34
0
        public ContactCollectionType GetItems()
        {
            ContactCollectionType result = new ContactCollectionType();

            foreach (OutlookInterop.ContactItem item in mAPI.Items.OfType <OutlookInterop.ContactItem>())
            {
                ContactType tmpItem = new ContactType();
                tmpItem.OriginId     = item.EntryID;
                tmpItem.OriginSystem = OriginSystemEnum.Outlook;
                tmpItem.LastModTime  = item.LastModificationTime;

                tmpItem.DisplayName = item.FullName;
                tmpItem.Title       = item.Title;
                tmpItem.Surname     = item.LastName;
                tmpItem.MiddleName  = item.MiddleName;
                tmpItem.GivenName   = item.FirstName;
                tmpItem.AddName     = item.Suffix;
                tmpItem.Company     = item.CompanyName;
                tmpItem.VIP         = (item.Importance == OutlookInterop.OlImportance.olImportanceHigh);
                tmpItem.SaveAs      = item.FileAs;
                if (item.Birthday.Year < 4000)
                {
                    tmpItem.Birthday = item.Birthday;
                }
                if (item.Anniversary.Year < 4000)
                {
                    tmpItem.AnniversaryDay = item.Anniversary;
                }
                tmpItem.Notes     = item.Body;
                tmpItem.IMAddress = item.IMAddress;

                //==========================
                //private data
                tmpItem.PrivateMailAddress = GetMailStruct(item.Email1DisplayName, item.Email1Address, item.Email1AddressType);
                //if no valid mail address could be delivered
                if ((tmpItem.PrivateMailAddress.Address ?? "") == "")
                {
                    tmpItem.PrivateMailAddress.Address = (tmpItem.IMAddress ?? "").Contains('@') ? tmpItem.IMAddress : null;
                }

                tmpItem.PrivateMobileNumber = item.MobileTelephoneNumber;
                tmpItem.PrivatePhoneNumber  = item.HomeTelephoneNumber;
                tmpItem.PrivateFaxNumber    = item.HomeFaxNumber;

                if ((item.HomeAddressStreet != null) || (item.HomeAddressPostalCode != null) || (item.HomeAddressCity != null) || (item.HomeAddressCountry != null))
                {
                    //tmpItem.PrivateLocation = new Address();
                    tmpItem.PrivateLocation.Street  = item.HomeAddressStreet?.Split(' ').First();
                    tmpItem.PrivateLocation.Number  = tmpItem.PrivateLocation.Street?.Substring(tmpItem.PrivateLocation.Street.Length - 1);
                    tmpItem.PrivateLocation.Zip     = item.HomeAddressPostalCode;
                    tmpItem.PrivateLocation.City    = item.HomeAddressCity;
                    tmpItem.PrivateLocation.Country = item.HomeAddressCountry;
                }

                //==========================
                //business data
                tmpItem.BusinessMailAddress = GetMailStruct(item.Email2DisplayName, item.Email2Address, item.Email2AddressType);
                //if no valid mail address could be delivered
                if ((tmpItem.BusinessMailAddress.Address ?? "") == "")
                {
                    tmpItem.BusinessMailAddress.Address = (tmpItem.IMAddress ?? "").Contains('@') ? tmpItem.IMAddress : null;
                }

                tmpItem.BusinessMobileNumber = item.Business2TelephoneNumber;
                tmpItem.BusinessPhoneNumber  = item.BusinessTelephoneNumber;
                tmpItem.BusinessFaxNumber    = item.BusinessFaxNumber;

                if ((item.BusinessAddressStreet != null) || (item.BusinessAddressPostalCode != null) || (item.BusinessAddressCity != null) || (item.BusinessAddressCountry != null))
                {
                    //tmpItem.BusinessLocation = new Address();
                    tmpItem.BusinessLocation.Street  = item.BusinessAddressStreet?.Split(' ').First();
                    tmpItem.BusinessLocation.Number  = tmpItem.BusinessLocation.Street?.Substring(tmpItem.BusinessLocation.Street.Length - 1);
                    tmpItem.BusinessLocation.Zip     = item.BusinessAddressPostalCode;
                    tmpItem.BusinessLocation.City    = item.BusinessAddressCity;
                    tmpItem.BusinessLocation.Country = item.BusinessAddressCountry;
                }

                //==========================
                //handle photo
                if (item.HasPicture)
                {
                    OutlookInterop.Attachment tmpPhotofile = item.Attachments["ContactPicture.jpg"];
                    //if a photo is attached
                    if (tmpPhotofile != null)
                    {
                        string tmpFilename = Environment.GetEnvironmentVariable("TEMP").TrimEnd('\\') + '\\' + item.EntryID + ".jpg";

                        tmpPhotofile.SaveAsFile(tmpFilename);
                        tmpItem.PictureTmpFilename = tmpFilename;
                    }
                    Marshal.ReleaseComObject(tmpPhotofile);
                }

                result.Add(tmpItem);
            }
            return(result);
        }
Exemple #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContactTypeDTO"/> class.
 /// </summary>
 /// <param name="c">
 /// The c.
 /// </param>
 public ContactTypeDTO(ContactType c)
 {
     this.contactTypeId = c.Id;
     this.contactType   = c.ContactTypeName;
     this.acType        = c.ACMappedType;
 }
Exemple #36
0
 internal ContactEmail(string email, ContactType contactType)
 {
     EmailAddress = email;
     ContactType  = contactType;
 }
Exemple #37
0
 /// <summary>
 /// Load the Contact from the XmlNode.
 /// </summary>
 /// <param name="objNode">XmlNode to load.</param>
 public void Load(XmlNode objNode)
 {
     _strName = objNode["name"].InnerText;
     try
     {
         _strRole = objNode["role"].InnerText;
     }
     catch
     {
     }
     try
     {
         _strLocation = objNode["location"].InnerText;
     }
     catch
     {
     }
     _intConnection = Convert.ToInt32(objNode["connection"].InnerText);
     _intLoyalty = Convert.ToInt32(objNode["loyalty"].InnerText);
     try
     {
         _intMembership = Convert.ToInt32(objNode["membership"].InnerText);
         _intAreaOfInfluence = Convert.ToInt32(objNode["areaofinfluence"].InnerText);
         _intMagicalResources = Convert.ToInt32(objNode["magicalresources"].InnerText);
         _intMatrixResources = Convert.ToInt32(objNode["matrixresources"].InnerText);
     }
     catch
     {
     }
     _objContactType = ConvertToContactType(objNode["type"].InnerText);
     try
     {
         _strFileName = objNode["file"].InnerText;
     }
     catch
     {
     }
     try
     {
         _strRelativeName = objNode["relative"].InnerText;
     }
     catch
     {
     }
     try
     {
         _strNotes = objNode["notes"].InnerText;
     }
     catch
     {
     }
     try
     {
         _strGroupName = objNode["groupname"].InnerText;
     }
     catch
     {
     }
     try
     {
         _objColour = Color.FromArgb(Convert.ToInt32(objNode["colour"].InnerText));
     }
     catch
     {
     }
     try
     {
         _blnFree = Convert.ToBoolean(objNode["free"].InnerText);
     }
     catch
     {
     }
     try
     {
         _blnFixed = Convert.ToBoolean(objNode["fixed"].InnerText);
     }
     catch
     {
     }
 }
Exemple #38
0
 public ContactPerson(ContactType type)
 {
     Type = type;
 }
Exemple #39
0
 public Contact(ContactType contactType, string description)
 {
     ContactType = contactType;
     Description = description;
 }
Exemple #40
0
 public ContactTypeViewModel(ContactType contactType)
 {
     Model = contactType;
 }
Exemple #41
0
        // Done!
        private static IList <Contact> GetContactsFromXmlDocument(XmlDocument doc)
        {
            IList <Contact> contacts = new List <Contact>(500);

            XmlNodeList nodes = doc.GetElementsByTagName("Contact");

            foreach (XmlElement node in nodes)
            {
                #region Extract Data From Xml

                Guid        contactID            = new Guid(node.GetElementByTagName("contactId").SafeInnerText("00000000-0000-0000-0000-000000000000"));
                ContactType contactType          = (ContactType)Enum.Parse(typeof(ContactType), node.GetElementByTagName("contactType").InnerText);
                string      quickName            = node.GetElementByTagName("quickName").SafeInnerText();
                string      passportName         = node.GetElementByTagName("passportName").SafeInnerText();
                bool        isPassportNameHidden = bool.Parse(node.GetElementByTagName("IsPassportNameHidden").SafeInnerText("false"));
                string      displayName          = node.GetElementByTagName("displayName").SafeInnerText();
                int         puid = int.Parse(node.GetElementByTagName("puid").SafeInnerText("-1"));
                long        cid  = long.Parse(node.GetElementByTagName("CID").SafeInnerText("0"));
                bool        isNotMobileVisible = bool.Parse(node.GetElementByTagName("IsNotMobileVisible").SafeInnerText("false"));
                bool        isMobileIMEnabled  = bool.Parse(node.GetElementByTagName("isMobileIMEnabled").SafeInnerText("false"));
                bool        isMessengerUser    = bool.Parse(node.GetElementByTagName("isMessengerUser").SafeInnerText("false"));
                bool        isFavorite         = bool.Parse(node.GetElementByTagName("isFavorite").SafeInnerText("false"));
                bool        isSmtp             = bool.Parse(node.GetElementByTagName("isSmtp").SafeInnerText("false"));
                bool        hasSpace           = bool.Parse(node.GetElementByTagName("hasSpace").SafeInnerText("false"));
                string      spotWatchState     = node.GetElementByTagName("spotWatchState").SafeInnerText();
                //DateTime birthdate = DateTime.Parse(node.GetElementByTagName("birthdate").SafeInnerText());
                string primaryEmailType = node.GetElementByTagName("primaryEmailType").SafeInnerText();
                string primaryLocation  = node.GetElementByTagName("PrimaryLocation").SafeInnerText();
                string primaryPhone     = node.GetElementByTagName("PrimaryPhone").SafeInnerText();
                bool   isPrivate        = bool.Parse(node.GetElementByTagName("IsPrivate").SafeInnerText("true"));
                string gender           = node.GetElementByTagName("gender").SafeInnerText();
                string timeZone         = node.GetElementByTagName("TimeZone").SafeInnerText();
                bool   fDeleted         = bool.Parse(node.GetElementByTagName("fDeleted").SafeInnerText("true"));
                //DateTime lastChange = DateTime.Parse(node.GetElementByTagName("lastChange").SafeInnerText());

                #endregion

                contacts.Add(new Contact
                {
                    ContactType          = contactType,
                    QuickName            = quickName,
                    DisplayName          = displayName,
                    PassportName         = passportName,
                    Gender               = gender,
                    CID                  = cid,
                    ContactID            = contactID,
                    Deleted              = fDeleted,
                    HasSpace             = hasSpace,
                    IsFavorite           = isFavorite,
                    IsMessengerUser      = isMessengerUser,
                    IsMobileIMEnabled    = isMobileIMEnabled,
                    IsNotMobileVisible   = isNotMobileVisible,
                    IsPassportNameHidden = isPassportNameHidden,
                    IsPrivate            = isPrivate,
                    IsSmtp               = isSmtp,
                    PrimaryEmailType     = primaryEmailType,
                    PrimaryLocation      = primaryLocation,
                    PrimaryPhone         = primaryPhone,
                    PUID                 = puid,
                    SpotWatchState       = spotWatchState,
                    TimeZone             = timeZone
                });
            }
            return(contacts);
        }
Exemple #42
0
        public void ServiceCalculateCorrectSalary(byte experience, ContactType contactType, decimal expected)
        {
            var result = _salaryService.CalculateSalary(experience, contactType);

            Assert.AreEqual(expected, result);
        }
Exemple #43
0
 public ContactInfo(ContactType type, string value, bool verified = false)
 {
     ContactType = type;
     Value       = value;
     Verified    = verified;
 }
Exemple #44
0
 public Address(string street, string city, string state, string country, string zipCode, ContactType contactType)
 {
     Street = street; City = city; State = state; Country = country; Zipcode = zipCode; Type = contactType;
 }
Exemple #45
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            //Get Item From Database
            ContactType contactType = new ContactType();

            contactType = contactTypeRepository.GetContactType(id);

            //Check Exists
            if (contactType == null)
            {
                ViewData["ActionMethod"] = "EditPost";
                return(View("RecordDoesNotExistError"));
            }

            //AccessRights
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToReferenceInfo())
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }


            //Update Item from Form
            try
            {
                UpdateModel(contactType);
            }
            catch
            {
                string n = "";
                foreach (ModelState modelState in ViewData.ModelState.Values)
                {
                    foreach (ModelError error in modelState.Errors)
                    {
                        n += error.ErrorMessage;
                    }
                }
                ViewData["Message"] = "ValidationError : " + n;
                return(View("Error"));
            }

            //Database Update
            try
            {
                contactType.VersionNumber = Int32.Parse(collection["VersionNumber"]);
                contactTypeRepository.Update(contactType);
            }
            catch (SqlException ex)
            {
                //Versioning Error - go to standard versionError page
                if (ex.Message == "SQLVersioningError")
                {
                    ViewData["ReturnURL"] = "/ContactType.mvc/Edit/" + id.ToString();
                    return(View("VersionError"));
                }
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return(View("Error"));
            }

            //Success
            return(RedirectToAction("List"));
        }
 public ContactType Add(ContactType input)
 {
     this.repository.Add(input);
     this.unitOfWork.SaveChanges();
     return(input);
 }
Exemple #47
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Contact" /> class.
 /// </summary>
 /// <param name="id">id.</param>
 /// <param name="type">type.</param>
 public Contact(decimal id = default(decimal), ContactType type = default(ContactType))
 {
     this.Id   = id;
     this.Type = type;
 }
Exemple #48
0
 public GGContact(uint number, ContactType type)
 {
     this.Number      = number;
     this.ContactType = type;
 }
Exemple #49
0
        internal void PopulateData()
        {
            using (var context = new AppDbContext(options, null))
            {
                if (context.AppUserAbsence.Count() < 1)
                {
                    var p1 = new AppUserAbsence {
                        AppUserAbsenceID = 1, Notes = "absence type 1",
                    };
                    var p2 = new AppUserAbsence {
                        AppUserAbsenceID = 2, Notes = "absence type 2",
                    };
                    context.AppUserAbsence.Add(p1);
                    context.AppUserAbsence.Add(p2);

                    context.SaveChanges();
                }

                if (context.AppUserAddress.Count() < 1)
                {
                    var p1 = new AppUserAddress {
                        AppUserAddressID = 1, Address1 = "address type 1", CountryID = 1, AddressTypeID = 1
                    };
                    var p2 = new AppUserAddress {
                        AppUserAddressID = 2, Address1 = "address type 2", CountryID = 1, AddressTypeID = 1
                    };
                    context.AppUserAddress.Add(p1);
                    context.AppUserAddress.Add(p2);

                    var p3 = new Country {
                        CountryID = 1, CountryName = "test country"
                    };
                    context.Country.Add(p3);
                    var p4 = new AddressType {
                        AddressTypeID = 1, AddressTypeName = "test address type"
                    };
                    context.AddressType.Add(p4);

                    context.SaveChanges();
                }

                if (context.AppUserCertificate.Count() < 1)
                {
                    var p1 = new AppUserCertificate {
                        AppUserCertificateID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserCertificate {
                        AppUserCertificateID = 2, CreatedBy = "user1",
                    };
                    context.AppUserCertificate.Add(p1);
                    context.AppUserCertificate.Add(p2);

                    context.SaveChanges();
                }

                if (context.AppUserContact.Count() < 1)
                {
                    var p1 = new AppUserContact {
                        AppUserContactID = 1, ContactTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserContact {
                        AppUserContactID = 2, ContactTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserContact.Add(p1);
                    context.AppUserContact.Add(p2);

                    if (context.ContactType.Count() < 1)
                    {
                        var p3 = new ContactType {
                            ContactTypeID = 1, ContactTypeName = "user1"
                        };
                        context.ContactType.Add(p3);
                    }
                    context.SaveChanges();
                }

                if (context.AppUserContract.Count() < 1)
                {
                    var p1 = new AppUserContract {
                        AppUserContractID = 1, ContractTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserContract {
                        AppUserContractID = 2, ContractTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserContract.Add(p1);
                    context.AppUserContract.Add(p2);

                    if (context.ContractType.Count() < 1)
                    {
                        var p3 = new ContractType {
                            ContractTypeID = 1, ContractTypeName = "contract 1"
                        };
                        context.ContractType.Add(p3);
                    }

                    context.SaveChanges();
                }

                if (context.AppUserCountry.Count() < 1)
                {
                    var p1 = new AppUserCountry {
                        AppUserCountryID = 1, CountryID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserCountry {
                        AppUserCountryID = 2, CountryID = 1, CreatedBy = "user1",
                    };
                    context.AppUserCountry.Add(p1);
                    context.AppUserCountry.Add(p2);

                    if (context.Country.Count() < 1)
                    {
                        var p3 = new Country {
                            CountryID = 1, CountryName = "country 1"
                        };
                        context.Country.Add(p3);
                    }

                    context.SaveChanges();
                }

                if (context.AppUserEducation.Count() < 1)
                {
                    var p1 = new AppUserEducation {
                        AppUserEducationID = 1, EducationTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserEducation {
                        AppUserEducationID = 2, EducationTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserEducation.Add(p1);
                    context.AppUserEducation.Add(p2);

                    if (context.EducationType.Count() < 1)
                    {
                        var p3 = new EducationType {
                            EducationTypeID = 1, EducationName = "education type 1"
                        };
                        context.EducationType.Add(p3);
                    }

                    context.SaveChanges();
                }

                if (context.AppUserEmploymentRecord.Count() < 1)
                {
                    var p1 = new AppUserEmploymentRecord {
                        AppUserEmploymentRecordID = 1, ContractTypeID = 1, DepartureTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserEmploymentRecord {
                        AppUserEmploymentRecordID = 2, ContractTypeID = 1, DepartureTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserEmploymentRecord.Add(p1);
                    context.AppUserEmploymentRecord.Add(p2);

                    if (context.ContractType.Count() < 1)
                    {
                        var p3 = new ContractType {
                            ContractTypeID = 1, ContractTypeName = "contract type 1"
                        };
                        context.ContractType.Add(p3);
                    }
                    if (context.DepartureType.Count() < 1)
                    {
                        var p3 = new DepartureType {
                            DepartureTypeID = 1, DepartureTypeName = "departure type 1"
                        };
                        context.DepartureType.Add(p3);
                    }

                    context.SaveChanges();
                }

                if (context.AppUserFunction.Count() < 1)
                {
                    var p1 = new AppUserFunction {
                        AppUserFunctionID = 1, FunctionTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserFunction {
                        AppUserFunctionID = 2, FunctionTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserFunction.Add(p1);
                    context.AppUserFunction.Add(p2);

                    if (context.FunctionType.Count() < 1)
                    {
                        var p3 = new FunctionType {
                            FunctionTypeID = 1, FunctionTypeName = "function type 1"
                        };
                        context.FunctionType.Add(p3);
                    }

                    context.SaveChanges();
                }

                if (context.AppUserInRole.Count() < 1)
                {
                    var p1 = new AppUserInRole {
                        AppUserInRoleID = 1, RoleTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserInRole {
                        AppUserInRoleID = 2, RoleTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserInRole.Add(p1);
                    context.AppUserInRole.Add(p2);

                    if (context.RoleType.Count() < 1)
                    {
                        var p3 = new RoleType {
                            RoleTypeID = 1, RoleTypeName = "role type 1"
                        };
                        context.RoleType.Add(p3);
                    }

                    context.SaveChanges();
                }

                if (context.AppUserLanguage.Count() < 1)
                {
                    var p1 = new AppUserLanguage {
                        AppUserLanguageID = 1, LanguageTypeID = 1, ProficiencyTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserLanguage {
                        AppUserLanguageID = 2, LanguageTypeID = 1, ProficiencyTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserLanguage.Add(p1);
                    context.AppUserLanguage.Add(p2);

                    if (context.LanguageType.Count() < 1)
                    {
                        var p3 = new LanguageType {
                            LanguageTypeID = 1, LanguageTypeName = "language type 1"
                        };
                        context.LanguageType.Add(p3);
                    }
                    if (context.ProficiencyType.Count() < 1)
                    {
                        var p3 = new ProficiencyType {
                            ProficiencyTypeID = 1, ProficiencyTypeName = "proficiency type 1"
                        };
                        context.ProficiencyType.Add(p3);
                    }
                    context.SaveChanges();
                }

                if (context.AppUserNote.Count() < 1)
                {
                    var p1 = new AppUserNote {
                        AppUserNoteID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserNote {
                        AppUserNoteID = 2, CreatedBy = "user1",
                    };
                    context.AppUserNote.Add(p1);
                    context.AppUserNote.Add(p2);

                    context.SaveChanges();
                }

                if (context.AppUserResearchTeam.Count() < 1)
                {
                    var p1 = new AppUserResearchTeam {
                        AppUserResearchTeamID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserResearchTeam {
                        AppUserResearchTeamID = 2, CreatedBy = "user1",
                    };
                    context.AppUserResearchTeam.Add(p1);
                    context.AppUserResearchTeam.Add(p2);

                    context.SaveChanges();
                }

                if (context.AppUserTeamAssignment.Count() < 1)
                {
                    var p1 = new AppUserTeamAssignment {
                        AppUserTeamAssignmentID = 1, TeamID = 1, AssignmentTypeID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserTeamAssignment {
                        AppUserTeamAssignmentID = 2, TeamID = 1, AssignmentTypeID = 1, CreatedBy = "user1",
                    };
                    context.AppUserTeamAssignment.Add(p1);
                    context.AppUserTeamAssignment.Add(p2);

                    if (context.Team.Count() < 1)
                    {
                        var p3 = new Team {
                            TeamID = 1, TeamName = "team 1"
                        };
                        context.Team.Add(p3);
                    }

                    if (context.AssignmentType.Count() < 1)
                    {
                        var p4 = new AssignmentType {
                            AssignmentTypeID = 1, AssignmentTypeName = "assignment type 1"
                        };
                        context.AssignmentType.Add(p4);
                    }

                    context.SaveChanges();
                }

                if (context.AppUserTeam.Count() < 1)
                {
                    var p1 = new AppUserTeam {
                        AppUserTeamID = 1, TeamID = 1, CreatedBy = "user1",
                    };
                    var p2 = new AppUserTeam {
                        AppUserTeamID = 2, TeamID = 1, CreatedBy = "user1",
                    };
                    context.AppUserTeam.Add(p1);
                    context.AppUserTeam.Add(p2);

                    if (context.Team.Count() < 1)
                    {
                        var p3 = new Team {
                            TeamID = 1, TeamName = "team 1"
                        };
                        context.Team.Add(p3);
                    }

                    context.SaveChanges();
                }
            }
        }
Exemple #50
0
 public void SetLocationOnContact()
 {
     Location = ContactExtraConfig
                .GetLocationFor(OrganizationId, Ministry.ToString(), ContactType.ToString(), ContactReason.ToString());
 }
        public ContactCardDto UpdateMailContact(int tenant, string user, int id, string name, string description,
                                                List <string> emails, List <string> phoneNumbers, ContactType type)
        {
            var contactCard = GetMailContact(tenant, user, id);

            if (null == contactCard)
            {
                throw new ArgumentException("Contact with specified id doesn't exist.");
            }

            var data = new List <ContactInfoDto>();

            using (var db = GetDb())
            {
                using (var tx = db.BeginTransaction())
                {
                    if (contactCard.name != name || contactCard.description != description || contactCard.type != (int)type)
                    {
                        var updateContact = new SqlUpdate(ContactsTable.Name)
                                            .Set(ContactsTable.Columns.ContactName, name)
                                            .Set(ContactsTable.Columns.Description, description)
                                            .Set(ContactsTable.Columns.Type, (int)type)
                                            .Where(ContactsTable.Columns.Id, id)
                                            .Where(ContactsTable.Columns.Tenant, tenant)
                                            .Where(ContactsTable.Columns.User, user);

                        db.ExecuteNonQuery(updateContact);
                    }

                    var deleteContactInfo = new SqlDelete(ContactInfoTable.Name)
                                            .Where(ContactInfoTable.Columns.ContactId, id)
                                            .Where(ContactInfoTable.Columns.Tenant, tenant)
                                            .Where(ContactInfoTable.Columns.User, user);

                    db.ExecuteNonQuery(deleteContactInfo);

                    for (var i = 0; i < emails.Count; i++)
                    {
                        var isPrimary     = i == 0;
                        var idContactInfo = SaveContactInfo(db, tenant, user, id, emails[i], ContactInfoType.Email, isPrimary);
                        data.Add(new ContactInfoDto(idContactInfo, tenant, user, id, emails[i], (int)ContactInfoType.Email, isPrimary));
                    }

                    for (var i = 0; i < phoneNumbers.Count; i++)
                    {
                        var isPrimary     = i == 0;
                        var idContactInfo = SaveContactInfo(db, tenant, user, id, phoneNumbers[i], ContactInfoType.Phone, isPrimary);
                        data.Add(new ContactInfoDto(idContactInfo, tenant, user, id, phoneNumbers[i], (int)ContactInfoType.Phone, isPrimary));
                    }

                    tx.Commit();
                }
            }

            return(new ContactCardDto(id, user, tenant, name, data, description, (int)type, false));
        }
Exemple #52
0
 public async void AddContactType(ContactType newContactType)
 {
     this.ContactTypes.Add(await this._contactTypeService.Add(newContactType));
 }
 /// <summary>
 /// Invoke action dependent on contact type
 /// </summary>
 /// <param name="contactType"></param>
 /// <returns></returns>
 public static Action ContactTypeAction(ContactType contactType) => contactType switch
 {
 public override int GetHashCode()
 {
     return((ContactType.ToString() + Data + Description).GetHashCode());
 }
 public PhoneAssociation(EntityId entityId, ResponseDictionary responseDictionary, TimePeriod validFor,
                         bool isHistorical, DateTime?contactCreationDate, ContactType contactType)
     : base(entityId, responseDictionary, validFor, isHistorical, contactCreationDate)
 {
     this.ContactType = contactType;
 }
Exemple #56
0
 internal ContactPhone(string phoneNumber, ContactType contactType)
 {
     PhoneNumber = phoneNumber;
     ContactType = contactType;
 }
Exemple #57
0
		/// <summary>
		/// Load the Contact from the XmlNode.
		/// </summary>
		/// <param name="objNode">XmlNode to load.</param>
		public void Load(XmlNode objNode)
		{
			_strName = objNode["name"].InnerText;
            try
            {
                _strRole = objNode["role"].InnerText;
            }
            catch
            {
            }
            try
            {
                _strLocation = objNode["location"].InnerText;
            }
            catch
            {
            }
            _intConnection = Convert.ToInt32(objNode["connection"].InnerText);
			_intLoyalty = Convert.ToInt32(objNode["loyalty"].InnerText);
            _objContactType = ConvertToContactType(objNode["type"].InnerText);
			try
			{
				_strFileName = objNode["file"].InnerText;
			}
			catch
			{
			}
			try
			{
				_strRelativeName = objNode["relative"].InnerText;
			}
			catch
			{
			}
			try
			{
				_strNotes = objNode["notes"].InnerText;
			}
			catch
			{
			}
			try
			{
				_strGroupName = objNode["groupname"].InnerText;
			}
			catch
			{
			}
			try
			{
				_objColour = Color.FromArgb(Convert.ToInt32(objNode["colour"].InnerText));
			}
			catch
			{
			}
			try
			{
				_blnFree = Convert.ToBoolean(objNode["free"].InnerText);
			}
			catch
			{
			}
            try
		    {
		        _blnIsGroup = Convert.ToBoolean(objNode["group"].InnerText);
		    }
		    catch
		    {
		    }
		    try
		    {
		        _strUnique = objNode["guid"].InnerText;
		    }
		    catch
		    {
		    }


			if (objNode["readonly"] != null) _readonly = true;
		    objNode.TryGetField("mademan", out _blnMadeMan);
		}
Exemple #58
0
 public void UpdateContactType(ContactType model)
 {
     _context.ContactTypes.Attach(model);
     _context.Entry(model).State = EntityState.Modified;
 }
 public ContactListScreenSource(List<MyPerson> ContactList,SwitchChangeDelegate SwitchChange,ContactType contactType)
 {
     this.ContactList=ContactList;
     this.SwitchChange = SwitchChange;
     this.contactType = contactType;
 }
Exemple #60
0
 public void CreateContactType(ContactType model)
 {
     _context.ContactTypes.Add(model);
 }