Ejemplo n.º 1
0
        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");
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 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());
 }
Ejemplo n.º 5
0
    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();
    }
Ejemplo n.º 6
0
        public void SetResponsible(Responsible responsible)
        {
            if (responsible == null)
            {
                throw new ArgumentNullException(nameof(responsible));
            }

            ResponsibleId = responsible.Id;
        }
Ejemplo n.º 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();
    }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 10
0
    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();
    }
Ejemplo n.º 11
0
    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();
    }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
    }
Ejemplo n.º 16
0
        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));
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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();
    }
Ejemplo n.º 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);
        }
Ejemplo n.º 21
0
 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();
     }
 }
Ejemplo n.º 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
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 24
0
 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);
     }
 }
Ejemplo n.º 25
0
        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);
                }
            }
        }
Ejemplo n.º 26
0
        public static bool ActivityTypeExists(Responsible responsible, ActivityType activityType)
        {
            foreach (var job in responsible.Jobs)
            {
                if (activityType == job.ActivityType)
                {
                    return(true);
                }
            }

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

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

            return(Ok(responsible.Id));
        }
Ejemplo n.º 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");
 }
Ejemplo n.º 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);
            }
Ejemplo n.º 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;
 }