public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as MessageHeader;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (TimestampElement != null)
                {
                    dest.TimestampElement = (Hl7.Fhir.Model.Instant)TimestampElement.DeepCopy();
                }
                if (Event != null)
                {
                    dest.Event = (Hl7.Fhir.Model.Coding)Event.DeepCopy();
                }
                if (Response != null)
                {
                    dest.Response = (Hl7.Fhir.Model.MessageHeader.MessageHeaderResponseComponent)Response.DeepCopy();
                }
                if (Source != null)
                {
                    dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopy();
                }
                if (Destination != null)
                {
                    dest.Destination = new List <Hl7.Fhir.Model.MessageHeader.MessageDestinationComponent>(Destination.DeepCopy());
                }
                if (Enterer != null)
                {
                    dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy();
                }
                if (Author != null)
                {
                    dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy();
                }
                if (Receiver != null)
                {
                    dest.Receiver = (Hl7.Fhir.Model.ResourceReference)Receiver.DeepCopy();
                }
                if (Responsible != null)
                {
                    dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy();
                }
                if (Reason != null)
                {
                    dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy();
                }
                if (Data != null)
                {
                    dest.Data = new List <Hl7.Fhir.Model.ResourceReference>(Data.DeepCopy());
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Exemple #2
0
        public async void LoginCommandExecute()
        {
            try
            {
                IsBusy = true;
                FirebaseAccess firebase = new FirebaseAccess();
                var            result   = await firebase.LoginAsync(Patient);

                if (!String.IsNullOrEmpty(result))
                {
                    await MessageService.Instance.ShowAsync(result);
                }
                else
                {
                    var user = await userRepository.GetByAccessTokenAsync(Settings.AccessToken);

                    Settings.Email = user.Email;
                    Settings.Type  = user.Type;


                    switch (user.Type)
                    {
                    case "admin":
                        await NavigationService.NavigateAsync("/NavigationPage/MenuAdminPage");

                        break;

                    case "responsible":
                        Responsible responsible = await responsibleRepository.GetByAccessTokenAsync(Settings.AccessToken);

                        Settings.UserId = responsible.Id;
                        await NavigationService.NavigateAsync("/NavigationPage/MenuResponsiblePage");

                        break;

                    case "intern":
                        Intern intern = await internRepository.GetByAccessTokenAsync(Settings.AccessToken);

                        Settings.UserId = intern.Id;
                        await NavigationService.NavigateAsync("/NavigationPage/MenuInternPage");

                        break;

                    case "host":
                        await NavigationService.NavigateAsync("/NavigationPage/MenuHostPage");

                        break;
                    }
                }
                IsBusy = false;
            }
            catch (Exception ex)
            {
                await MessageService.Instance.ShowAsync(ex.ToString());

                throw;
            }
        }
        private static Responsible SeedResponsible(PreservationContext dbContext, string plant)
        {
            var responsibleRepository = new ResponsibleRepository(dbContext);
            var responsible           = new Responsible(plant, KnownTestData.ResponsibleCode, KnownTestData.ResponsibleDescription);

            responsibleRepository.Add(responsible);
            dbContext.SaveChangesAsync().Wait();
            return(responsible);
        }
 private static void SetNeeds(Responsible human)
 {
     human.Needs.Add(NeedType.Hunger, NeedFactory.GetHunger());
     human.Needs.Add(NeedType.Fun, NeedFactory.GetFun());
     human.Needs.Add(NeedType.Energy, NeedFactory.GetEnergy());
     human.Needs.Add(NeedType.Social, NeedFactory.GetSocial());
     human.Needs.Add(NeedType.Bladder, NeedFactory.GetBladder());
     human.Needs.Add(NeedType.Hygiene, NeedFactory.GetHygiene());
 }
    public virtual IEnumerator Drop(Responsible responsible)
    {
        yield return(Util.WaitForSeconds(responsible.GetCurrentJob(), dropDuration));

        responsible.Inventory.Remove(gameObject);
        gameObject.transform.position = responsible.directionPosition.transform.position;
        SetPicked(false);
        responsible.FinishJob();
    }
Exemple #6
0
        public void SetResponsible(Responsible responsible)
        {
            if (responsible == null)
            {
                throw new ArgumentNullException(nameof(responsible));
            }

            ResponsibleId = responsible.Id;
        }
Exemple #7
0
    public IEnumerator Shower(Responsible responsible)
    {
        yield return(StartCoroutine(responsible.Walk(interactionPoint.transform.position)));

        responsible.GetCurrentJob().SetProgressDuration(10);
        yield return(new WaitForSeconds(10));

        responsible.FinishJob();
    }
Exemple #8
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as MessageHeader;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (Event != null)
            {
                dest.Event = (Hl7.Fhir.Model.Element)Event.DeepCopy();
            }
            if (Destination != null)
            {
                dest.Destination = new List <Hl7.Fhir.Model.MessageHeader.MessageDestinationComponent>(Destination.DeepCopy());
            }
            if (Sender != null)
            {
                dest.Sender = (Hl7.Fhir.Model.ResourceReference)Sender.DeepCopy();
            }
            if (Enterer != null)
            {
                dest.Enterer = (Hl7.Fhir.Model.ResourceReference)Enterer.DeepCopy();
            }
            if (Author != null)
            {
                dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy();
            }
            if (Source != null)
            {
                dest.Source = (Hl7.Fhir.Model.MessageHeader.MessageSourceComponent)Source.DeepCopy();
            }
            if (Responsible != null)
            {
                dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy();
            }
            if (Reason != null)
            {
                dest.Reason = (Hl7.Fhir.Model.CodeableConcept)Reason.DeepCopy();
            }
            if (Response != null)
            {
                dest.Response = (Hl7.Fhir.Model.MessageHeader.ResponseComponent)Response.DeepCopy();
            }
            if (Focus != null)
            {
                dest.Focus = new List <Hl7.Fhir.Model.ResourceReference>(Focus.DeepCopy());
            }
            if (DefinitionElement != null)
            {
                dest.DefinitionElement = (Hl7.Fhir.Model.Canonical)DefinitionElement.DeepCopy();
            }
            return(dest);
        }
Exemple #9
0
        public RegisterResponsiblePageViewModel(INavigationService navigationService, IResponsibleRepository responsibleRepository, IInternRepository internRepository, IUserRepository userRepository)
            : base(navigationService)
        {
            this.navigationService     = navigationService;
            this.responsibleRepository = responsibleRepository;
            this.internRepository      = internRepository;
            this.userRepository        = userRepository;

            Responsible = new Responsible();
        }
    public IEnumerator Eat(Responsible responsible)
    {
        yield return(StartCoroutine(responsible.Walk(interactionPoint.transform.position)));

        yield return(Util.WaitForSeconds(responsible.GetCurrentJob(), eatDuration));

        responsible.Heal(20);
        Destroy(gameObject, 0.5f);
        responsible.FinishJob();
    }
    public virtual IEnumerator Pick(Responsible responsible)
    {
        yield return(StartCoroutine(responsible.Walk(interactionPoint.transform.position)));

        yield return(Util.WaitForSeconds(responsible.GetCurrentJob(), _pickDuration));

        responsible.Inventory.Add(this.gameObject);
        SetPicked(true);
        responsible.FinishJob();
    }
        public void SetResponsible_ShouldSetResponsible()
        {
            var responsibleId = 1;
            var responsible   = new Responsible(_dut.Plant, "C", "Desc");

            responsible.SetProtectedIdForTesting(responsibleId);
            _dut.SetResponsible(responsible);

            Assert.AreEqual(responsibleId, _dut.ResponsibleId);
        }
        public void Setup()
        {
            _mode = new Mode(TestPlant, "SUP", true);
            _mode.SetProtectedIdForTesting(3);

            _responsible = new Responsible(TestPlant, "RC", "RD");
            _responsible.SetProtectedIdForTesting(4);

            _dut = new Step(TestPlant, "S", _mode, _responsible);
        }
Exemple #14
0
        public Responsible Update(ResponsibleRequest req)
        {
            Responsible responsible = db.Responsibles.Find(req.Id);

            responsible.Name  = req.Name;
            responsible.Email = req.Email;

            db.SaveChanges();
            return(responsible);
        }
Exemple #15
0
    public static void ProgressKillQuests(Responsible responsible, GameObject damagable)
    {
        var killQuests = QuestManager.FindWithActivityType(responsible, ActivityType.Kill);

        foreach (var quest in killQuests)
        {
            quest.Progress(ActivityType.Kill, damagable.GetComponent <Interactable.Base.Interactable>().GetGroupName());
        }
        UIManager.Instance.SetQuests(responsible);
    }
        public async Task <IActionResult> Create([Bind("Id,Name")] Responsible responsible)
        {
            if (ModelState.IsValid)
            {
                _context.Add(responsible);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(responsible));
        }
Exemple #17
0
 public static void AddSkill(Responsible responsible, Skill skill)
 {
     if (skill.Type == SkillType.None)
     {
         return;
     }
     if (!responsible.Skills.ContainsKey(skill.Type))
     {
         responsible.Skills.Add(skill.Type, skill);
     }
 }
Exemple #18
0
    public IEnumerator Mine(Responsible responsible)
    {
        yield return(StartCoroutine(responsible.Walk(interactionPoint.transform.position)));

        yield return(Util.WaitForSeconds(responsible.GetCurrentJob(), mineDuration));

        GroundUtil.Clear(gameObject.transform.position);
        responsible.Inventory.Add(CreateStone());
        Destroy(gameObject, 0.5f);
        responsible.FinishJob();
    }
Exemple #19
0
        public IEnumerator Chop(Responsible responsible)
        {
            yield return(StartCoroutine(responsible.Walk(interactionPoint.transform.position)));

            yield return(Util.WaitForSeconds(responsible.GetCurrentJob(), SkillManager.GetSkillBonusForDuration(responsible, chopDuration)));

            GroundUtil.Clear(gameObject.transform.position);
            responsible.Inventory.Add(CreateProduct());
            Destroy(gameObject);
            responsible.FinishJob();
        }
        public void RenameResponsible_ShouldSetNewCode()
        {
            var newCode = "Code9";
            var dut     = new Responsible("PlantA", "CodeA", "DescA");

            Assert.AreNotEqual(newCode, dut.Code);

            dut.RenameResponsible(newCode);

            Assert.AreEqual(newCode, dut.Code);
        }
 public static void Remove(Responsible responsible, List <Effect> effects)
 {
     foreach (var effect in effects)
     {
         if (!responsible.Needs.ContainsKey(effect.NeedType))
         {
             break;
         }
         responsible.Needs[effect.NeedType].Reset();
     }
 }
Exemple #22
0
 static void Main(string[] args)
 {
     //Responsible responsible = new Responsible()
     //{
     //    //I want here to populate with PopulatePerson the base members
     //    Phone = "93827382",
     //    Company = "Google"
     //};
     var responsible = Responsible.Populate("Glenn", "Fake", "93827382", "Google");
     //responsible
 }
Exemple #23
0
        public void Insert(Responsible responsavel)
        {
            var sql = "INSERT INTO Responsible" +
                      " (Id,Name,CREA,Email,Phone)" +
                      " VALUES" +
                      " (@Id,@Name,@CREA,@Email,@Phone)";

            using (var db = _DB.GetCon())
            {
                db.Execute(sql, responsavel);
            }
        }
 public static void Apply(Responsible responsible, List <Effect> effects)
 {
     foreach (var effect in effects)
     {
         if (!responsible.Needs.ContainsKey(effect.NeedType))
         {
             continue;
         }
         responsible.Needs[effect.NeedType].StepValue = effect.StepValue;
         Debug.Log("Affecting " + effect.NeedType);
     }
 }
        public IEnumerator Craft(Responsible responsible)
        {
            yield return(Util.WaitForSeconds(responsible.GetCurrentJob(), Duration));

            foreach (var ingredient in Ingredients)
            {
                if (responsible.Inventory.FindCount(ingredient.Name) >= ingredient.Amount)
                {
                    responsible.Inventory.Remove(ingredient.Name, ingredient.Amount);
                }
            }
        }
        public static bool ActivityTypeExists(Responsible responsible, ActivityType activityType)
        {
            foreach (var job in responsible.Jobs)
            {
                if (activityType == job.ActivityType)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #27
0
        public IHttpActionResult PostResponsible(Responsible responsible)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Responsibles.Add(responsible);
            db.SaveChanges();

            return(Ok(responsible.Id));
        }
Exemple #28
0
 public static void Responsibles()
 {
     GenericCollection.responsibles.Clear();
     e = Responsible.ListOnline("SELECT * FROM responsible");
     ProcessWindow._Form1.FeedBack("Downloading Responsible... " + e.Count);
     foreach (var h in e)
     {
         Responsible p = new Responsible(h.Id, h.UserID, h.CustomerID, DateTime.Now.ToString("dd-MM-yyyy H:m:s"), "true", Helper.CompanyID);
         GenericCollection.responsibles.Add(p);
     }
     ProcessWindow._Form1.FeedBack("Downloading Responsibility  Complete");
 }
Exemple #29
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as DetailsComponent;

                if (dest == null)
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }

                base.CopyTo(dest);
                if (Identifier != null)
                {
                    dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy();
                }
                if (Predecessor != null)
                {
                    dest.Predecessor = (Hl7.Fhir.Model.Identifier)Predecessor.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Request != null)
                {
                    dest.Request = (Hl7.Fhir.Model.ResourceReference)Request.DeepCopy();
                }
                if (Submitter != null)
                {
                    dest.Submitter = (Hl7.Fhir.Model.ResourceReference)Submitter.DeepCopy();
                }
                if (Response != null)
                {
                    dest.Response = (Hl7.Fhir.Model.ResourceReference)Response.DeepCopy();
                }
                if (DateElement != null)
                {
                    dest.DateElement = (Hl7.Fhir.Model.Date)DateElement.DeepCopy();
                }
                if (Responsible != null)
                {
                    dest.Responsible = (Hl7.Fhir.Model.ResourceReference)Responsible.DeepCopy();
                }
                if (Payee != null)
                {
                    dest.Payee = (Hl7.Fhir.Model.ResourceReference)Payee.DeepCopy();
                }
                if (Amount != null)
                {
                    dest.Amount = (Hl7.Fhir.Model.Money)Amount.DeepCopy();
                }
                return(dest);
            }
Exemple #30
0
        public IEnumerator Harvest(Responsible responsible)
        {
            yield return(StartCoroutine(responsible.Walk(interactionPoint.transform.position)));

            responsible.animator.SetBool("isHarvesting", true);
            yield return(Util.WaitForSeconds(responsible.GetCurrentJob(), harvestDuration));

            responsible.animator.SetBool("isHarvesting", false);
            GroundUtil.Clear(gameObject.transform.position);
            responsible.Inventory.Add(CreateProduct());
            Destroy(gameObject, 0.5f);
            responsible.FinishJob();
        }
 /// <summary>
 /// No hay ningún comentario para Responsible en el esquema.
 /// </summary>
 public void AddToResponsible(Responsible responsible)
 {
     base.AddObject("Responsible", responsible);
 }
 /// <summary>
 /// Crear un nuevo objeto Responsible.
 /// </summary>
 /// <param name="id">Valor inicial de Id.</param>
 /// <param name="name">Valor inicial de Name.</param>
 /// <param name="lastName">Valor inicial de LastName.</param>
 /// <param name="email">Valor inicial de Email.</param>
 /// <param name="phone">Valor inicial de Phone.</param>
 public static Responsible CreateResponsible(global::System.Guid id, string name, string lastName, string email, string phone)
 {
     Responsible responsible = new Responsible();
     responsible.Id = id;
     responsible.Name = name;
     responsible.LastName = lastName;
     responsible.Email = email;
     responsible.Phone = phone;
     return responsible;
 }