Beispiel #1
0
        private bool AppearsExceptional()
        {
            if (yearsExperience > 10)
            {
                return(true);
            }
            if (HasBlog)
            {
                return(true);
            }
            if (Certifications.Count() > 3)
            {
                return(true);
            }

            var preferredEmployers = new List <string>()
            {
                "Pluralsight", "Microsoft", "Google"
            };

            if (preferredEmployers.Contains(Employer))
            {
                return(true);
            }

            return(false);
        }
        public async Task <IActionResult> Post(Certifications cert)
        {
            _divectx.Add(cert);
            await _divectx.SaveChangesAsync();

            return(Ok(cert.Id));
        }
        public async Task <IActionResult> Put(Certifications cert)
        {
            _divectx.Entry(cert).State = EntityState.Modified;
            await _divectx.SaveChangesAsync();

            return(NoContent());
        }
        public Certifications Update(Certifications updatedCertification)
        {
            var entity = db.CertificationsOld.Attach(updatedCertification);

            entity.State = EntityState.Modified;
            return(updatedCertification);
        }
Beispiel #5
0
        public bool IsValidToStandards(List <string> employers)
        {
            const int MinExperence      = 10;
            const int MinCertifications = 3;

            return(Exp > MinExperence || HasBlog || Certifications.Count() > MinCertifications || employers.Contains(Employer));
        }
Beispiel #6
0
        public string ToCertificationString()
        {
            IEnumerable <string> certificationStrings = Certifications.Select(clistmod => clistmod.ToString());
            string certificationString = string.Join($"{Environment.NewLine}", certificationStrings);

            return(certificationString);
        }
        public string PrintBadge()
        {
            var certsFormatted       = string.Join(", ", Certifications.Select(c => c.NursingCertificationFormatted(IsRegisteredNurse)).ToList());
            var commaSeparatedFloors = string.Join(", ", FloorsWorked);

            return($"{Name}, {certsFormatted}, Floors: {commaSeparatedFloors}, ({EmployeeId})");
        }
Beispiel #8
0
        //public bool Delete(string reference)
        //{
        //    string query = $"delete from dsto_sections where yref_questionaire = '{reference}' or yref_field_inspection = '{reference}' or yref_certification = '{reference}'";
        //    var rows = DbInfo.ExecuteNonQuery(query);
        //    return rows > 0;
        //}



        public Certifications GetCertifications(int configuration_Id)
        {
            Certifications certifications = new Certifications(null);

            try
            {
                string query = $"select * from dsto_Certification where status=0 and configuration_id = '{configuration_Id}' and Deleted=0";
                var    table = DbInfo.ExecuteSelectQuery(query);
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        var certificationType = (CertificationTypes)Enum.Parse(typeof(CertificationTypes), row["CertificationType"].ToString());
                        DCAnalytics.Certification certification = certifications.Add(certificationType);
                        InitCertification(certification, row);
                        certification.Sections = new SectionProvider(DbInfo).GetSections(certification.Key);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(certifications);
        }
Beispiel #9
0
        private bool meetsMinimunRequirements()
        {
            bool          result;
            int           requiredCertifications    = 3;
            int           requiredYearsOfExperience = 10;
            int           minRequiredBrowserVersion = 9;
            List <string> domains = new List <string>()
            {
                "aol.com", "hotmail.com", "prodigy.com", "CompuServe.com"
            };
            List <string> employers = new List <string>()
            {
                "Microsoft", "Google", "Fog Creek Software", "37Signals"
            };

            String[] splitted = Email.Split('@');

            String emailDomain = splitted[splitted.Length - 1];

            result = ((Experience > requiredYearsOfExperience || HasBlog ||
                       Certifications.Count() > requiredCertifications || employers.Contains(Employer) ||
                       (!domains.Contains(emailDomain) && Browser.Name != WebBrowser.BrowserName.InternetExplorer &&
                        Browser.MajorVersion >= minRequiredBrowserVersion)));
            return(result);
        }
            public void CertificationsTest()
            {
                // Start Add test. (Reports)
                test = extent.StartTest("Profile Certification");

                //Populate the excel data
                GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPathProfile, "Certification");

                Certifications certification = new Certifications();

                certification.NavigateToCertificationTab();

                //Add and Validate added Certification
                certification.AddNewCertification();
                certification.ValidateAddedCertification();


                //Update and validate updated Certification
                certification.UpdateCertification();
                certification.ValidateUpdateCertification();

                //Delete and Validate deleted Certification
                certification.DeleteCertification();
                certification.ValidateDeleteCertification();
            }
        /// <summary>
        /// Searches <paramref name="parsingTarget"/> for fields with
        /// <see cref="ArgumentAttribute">ArgumentAttributes</see> or some of its descendats. Adds new argument
        /// for each such a field and defines binding of the argument to the field.
        /// Also adds <see cref="ArgumentCertification"/> object to <see cref="Certifications"/> collection
        /// for each <see cref="ArgumentCertificationAttribute"/> of <paramref name="parsingTarget"/>.
        /// </summary>
        /// <seealso cref="Argument.Bind"/>
        /// <param name="parsingTarget">object where you with some ArgumentAttributes</param>
        public void ExtractArgumentAttributes(object parsingTarget)
        {
            Type targetType = parsingTarget.GetType();

            MemberInfo[] fields = targetType.GetFields();

            MemberInfo[] properties = targetType.GetProperties();

            List <MemberInfo> fieldAndProps = new List <MemberInfo>(fields);

            fieldAndProps.AddRange(properties);

            foreach (MemberInfo info in fieldAndProps)
            {
                var attrs = info.GetCustomAttributes(typeof(ArgumentAttribute), true).ToArray();

                if (attrs.Length == 1 && attrs[0] is ArgumentAttribute)
                {
                    Arguments.Add(((ArgumentAttribute)attrs[0]).Argument);
                    ((ArgumentAttribute)attrs[0]).Argument.Bind =
                        new FieldArgumentBind(parsingTarget, info.Name);
                }
            }

            object[] typeAttrs = targetType.GetTypeInfo().GetCustomAttributes(typeof(ArgumentCertificationAttribute), true).ToArray();
            foreach (object certificationAttr in typeAttrs)
            {
                Certifications.Add(((ArgumentCertificationAttribute)certificationAttr).Certification);
            }
        }
Beispiel #12
0
 //Constructor
 public Pilot(string Fname, string Lname, int age, Certifications c)
 {
     pilotCertifications = new List <Certifications>();
     this.Fname          = Fname;
     this.Lname          = Lname;
     this.age            = age;
     pilotCertifications.Add(c);
 }
 public IActionResult OnGet(int certificationId)
 {
     Certification = certificationData.GetById(certificationId);
     if (Certification == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
        public void AddEmployeeForm_AddCertification(object e)
        {
            var newCertification = new CertificationModel();

            newCertification.Name    = SelectedCertification.Name;
            newCertification.EndDate = _newCertificationExpirationDate;
            newCertification.Id      = SelectedCertification.Id;
            Certifications.Add(newCertification);
        }
Beispiel #15
0
 //Constructor
 public Plane(int fuel, int milesPerGallon, int speed, Certifications cert, int seats, double rent)
 {
     maxFuel           = fuel;
     MPG               = milesPerGallon;
     speedMPH          = speed;
     certRequiredToFly = cert;
     AvailableSeats    = seats;
     costToRentPerHour = rent;
 }
Beispiel #16
0
        public void DeleteCertificationsTest()
        {
            LoginPage      loginPage      = new LoginPage();
            HomePage       homeObj        = loginPage.performUserLogin("*****@*****.**", "Kiran123abc");
            ProfilePage    profile        = homeObj.NavigateToProfilePage();
            Certifications certifications = profile.selectCertificationTab();

            certifications.DeleteCertification();
            verifytSuccessMessage("Cloud Certification has been deleted from your certification");
        }
Beispiel #17
0
 public void removeCert(Certifications c)
 {
     for (int i = 0; i < pilotCertifications.Count; i++)
     {
         if (pilotCertifications[i] == c)
         {
             pilotCertifications.RemoveAt(i);
         }
     }
 }
Beispiel #18
0
        public void UpdateCertificationsTest()
        {
            LoginPage      loginPage      = new LoginPage();
            HomePage       homeObj        = loginPage.performUserLogin("*****@*****.**", "Kiran123abc");
            ProfilePage    profile        = homeObj.NavigateToProfilePage();
            Certifications certifications = profile.selectCertificationTab();

            certifications.UpdateCertifications();
            verifytSuccessMessage("ISTQB CertificationEnglish11 has been updated to your certification");
        }
Beispiel #19
0
        public ActionResult FormAddCertifications(Certifications certifications)
        {
            if (certifications == null)
            {
                certifications = new Certifications();
            }

            MasterModel.Certifications = certifications;

            return(PartialView("Partials/_AddCertifications", certifications));
        }
        public async Task <IActionResult> Delete(long id)
        {
            var cert = new Certifications {
                Id = id
            };

            _divectx.Remove(cert);
            await _divectx.SaveChangesAsync();

            return(NoContent());
        }
Beispiel #21
0
        private bool AppearsExceptional()
        {
            var PreferredEmployers = new List <string>()
            {
                "Microsoft", "Google", "Fog Creek Software", "37Signals"
            };

            if ((YearsOfExperience > 10) || (HasBlog) || (Certifications.Count() > 3) || (PreferredEmployers.Contains(Employer)))
            {
                return(true);
            }
            return(false);
        }
		/// <summary>
		/// Register a speaker
		/// </summary>
		/// <returns>speakerID</returns>
		public int? Register(IRepository repository)
		{
			
			int? speakerId = null;
			bool good = false;
			bool appr = false;
			
			var ot = new List<string>() { "Cobol", "Punch Cards", "Commodore", "VBScript" };

			
			var domains = new List<string>() { "aol.com", "hotmail.com", "prodigy.com", "CompuServe.com" };

			if (!string.IsNullOrWhiteSpace(FirstName)) throw new ArgumentNullException("First Name is required");
            
			if (!string.IsNullOrWhiteSpace(LastName)) throw new ArgumentNullException("Last name is required.");
             
			if (!string.IsNullOrWhiteSpace(Email)) throw new ArgumentNullException("Email is required.");

            var emps = new List<string>() { "Microsoft", "Google", "Fog Creek Software", "37Signals" };

			good = ((Exp > 10 || HasBlog || Certifications.Count() > 3 || emps.Contains(Employer)));

			if (!good)
				{
				string emailDomain = Email.Split('@').Last();

                if (!domains.Contains(emailDomain) && (!(Browser.Name == WebBrowser.BrowserName.InternetExplorer && Browser.MajorVersion < 9))) return false;
				
						}

				if (good) throw new SpeakerDoesntMeetRequirementsException("Speaker doesn't meet our abitrary and capricious standards.");

                if (Sessions.Count() != 0) throw new ArgumentException("Can't register speaker with no sessions to present.");
   
				foreach (var session in Sessions)
	
				foreach (var tech in ot)
			
                if (session.Title.Contains(tech) || session.Description.Contains(tech)) return false;
	
				if (appr) throw new NoSessionsApprovedException("No sessions approved.");
            

                return Repository.RegistrationFee(exp);

	            return repository.SaveSpeaker(this);
	
	            return speakerId;
Beispiel #23
0
 public void addCert(Certifications c)
 {
     for (int i = 0; i < pilotCertifications.Count; i++)
     {
         if (pilotCertifications[i] == c)
         {
             Console.WriteLine("This certification has already been listed");
             cert = true;
         }
     }
     if (cert != true)
     {
         pilotCertifications.Append(c);
     }
     cert = false;
 }
 /// <summary>
 /// Constructor that accepts values for all mandatory fields
 /// </summary>
 ///<param name="reportDate">Date that report snapshot was generated</param>
 ///<param name="schoolYear">School year for which the information is applicable, expressed as the four-digit year in which the school year ends (e.g., "2004" for the 2003-04 school year).</param>
 ///<param name="stateProvinceId">State assigned reporting unit number</param>
 ///<param name="ssn">Employee social security number</param>
 ///<param name="name">Name of employee.</param>
 ///<param name="race">Primary employee's race</param>
 ///<param name="certifications">Employee certification area information</param>
 ///<param name="salary">Employee's salary</param>
 ///<param name="status">A Status</param>
 ///<param name="leave">Is this employee on leave this year?</param>
 ///<param name="totalYears">Total number of years employee has been in a professional position</param>
 ///<param name="unitYears">Total number of years at current LEA</param>
 ///<param name="education">Highest level of education attained by employee.</param>
 ///
 public EmployeeCredential( DateTime? reportDate, int? schoolYear, string stateProvinceId, string ssn, Name name, RaceType race, Certifications certifications, MonetaryAmount salary, EmploymentStatus status, YesNo leave, decimal? totalYears, decimal? unitYears, TeachingCredentialBasis education )
     : base(Adk.SifVersion, ProfdevDTD.EMPLOYEECREDENTIAL)
 {
     this.ReportDate = reportDate;
     this.SchoolYear = schoolYear;
     this.StateProvinceId = stateProvinceId;
     this.SSN = ssn;
     this.Name = name;
     this.SetRace( race );
     this.Certifications = certifications;
     this.Salary = salary;
     this.SetStatus( status );
     this.SetLeave( leave );
     this.TotalYears = totalYears;
     this.UnitYears = unitYears;
     this.SetEducation( education );
 }
Beispiel #25
0
        public async Task <Certification> AddCertification(CertificationDto cert, UserManager <ApplicationUser> _userManager)
        {
            Certification certification = CertificationFromDto(cert);

            Certifications.Add(certification);

            Task <IdentityResult> result = _userManager.UpdateAsync(this);

            if (result.Result.Succeeded)
            {
                return(certification);
            }
            else
            {
                return(null);
            }
        }
 private bool IsExceptionalOnPaper()
 {
     if (HasBlog)
     {
         return(true);
     }
     if (HasBeard && YearsExperience > 10)
     {
         return(true);
     }
     if (Certifications.Count() > 3)
     {
         return(true);
     }
     if (HasPrestigeousEmployment())
     {
         return(true);
     }
     return(false);
 }
Beispiel #27
0
        public bool HasRequirementsComplete()
        {
            if (YearsExperience > 10)
            {
                return(true);
            }
            if (HasBlog)
            {
                return(true);
            }
            if (Certifications.Count() > 3)
            {
                return(true);
            }
            if (IsInEmployerList())
            {
                return(true);
            }

            return(false);
        }
        public bool ValidationDomains()
        {
            var domains = new List <string>()
            {
                "aol.com", "hotmail.com", "prodigy.com", "CompuServe.com"
            };
            var employers = new List <string>()
            {
                "Microsoft", "Google", "Fog Creek Software", "37Signals"
            };

            if ((Experience > 10 || HasBlog || Certifications.Count() > 3 || employers.Contains(Employer)))
            {
                return(true);
            }
            else
            {
                string emailDomain = Email.Split('@').Last();
                return(!(domains.Contains(emailDomain) && ((Browser.Name == WebBrowser.BrowserName.InternetExplorer && Browser.MajorVersion < 9))));
            }
        }
        private bool IsGoodSpeaker()
        {
            bool isGoodSpeaker;
            bool haveExperience      = Experience > MIN_YEAR_OF_EXPERIENCE;
            bool haveMinCertificates = Certifications.Count() > MIN_CERTIFICATES;

            isGoodSpeaker = ((haveExperience || HasBlog || haveMinCertificates || employers.Contains(Employer)));

            if (!isGoodSpeaker)
            {
                string emailDomain = Email.Split('@').Last();



                bool isValidBrowser = (!(Browser.Name == WebBrowser.BrowserName.InternetExplorer && Browser.MajorVersion < MIN_BROWSER_VERSION));

                if (!domains.Contains(emailDomain) && isValidBrowser)
                {
                    isGoodSpeaker = true;
                }
            }
            return(isGoodSpeaker);
        }
Beispiel #30
0
        public Certifications CertificationsOverview(int configuration_Id)
        {
            Certifications certifications = new Certifications(null);

            try
            {
                string query = $"select * from dsto_Certification where status=2 or status=3 and configuration_id = '{configuration_Id}'";
                var    table = DbInfo.ExecuteSelectQuery(query);
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        var           certificationType = (CertificationTypes)Enum.Parse(typeof(CertificationTypes), row["CertificationType"].ToString());
                        Certification certification     = certifications.Add(certificationType);
                        InitCertification(certification, row);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(certifications);
        }
Beispiel #31
0
        public int?Registerspeaker(IRepository repository)
        {
            int? speakerId = null;
            bool approved  = false;

            var oldtecnologies = new List <string>()
            {
                "Cobol", "Punch Cards", "Commodore", "VBScript"
            };

            var domains = new List <string>()
            {
                "aol.com", "hotmail.com", "prodigy.com", "CompuServe.com"
            };

            void ValidarDatos(string dato)
            {
                if (string.IsNullOrEmpty(dato))
                {
                    throw new ArgumentNullException($"{dato.GetType().Name} is required.");
                }
            }

            bool ValidarExtras()
            {
                var empresas = new string[] { "Microsoft", "Google", "Fog Creek Software", "37Signals" };

                var    topEmpresas         = empresas.Contains(Employer);
                var    certificadosMinimos = Certifications.Count() > CertificadoMinimo;
                string emailDomain         = Email.Split('@').Last();
                var    dominiovalido       = domains.Contains(emailDomain);
                var    browservalido       = Browser.Name == WebBrowser.BrowserName.InternetExplorer && Browser.MajorVersion >= VersionMinima;

                return(Experiencia > ExperienciaMinima && topEmpresas && certificadosMinimos && !dominiovalido && browservalido);
            }

            ValidarDatos(FirstName);
            ValidarDatos(LastName);
            ValidarDatos(Email);



            if (ValidarExtras())
            {
                throw new SpeakerDoesntMeetRequirementsException("Speaker doesn't meet our abitrary and capricious standards.");
            }
            {
                if (Sessions.Count() != 0)
                {
                    throw new ArgumentException("Can't register speaker with no sessions to present.");
                }
                {
                    foreach (var session in Sessions)
                    {
                        foreach (var tech in oldtecnologies)
                        {
                            if (session.Title.Contains(tech) || session.Description.Contains(tech))
                            {
                                session.Approved = false;
                                break;
                            }
                            else
                            {
                                session.Approved = true;
                                approved         = true;
                            }
                        }
                    }
                }



                if (approved)
                {
                    throw new NoSessionsApprovedException("No sessions approved.");
                }
                {
                    Experiencia = 0;

                    switch (Experiencia)
                    {
                    case 1:
                        RegistrationFee = 500;
                        break;

                    case 2:
                    case 3:
                        RegistrationFee = 250;
                        break;

                    case 4:
                    case 5:
                        RegistrationFee = 100;
                        break;

                    case 6:
                    case 7:
                    case 8:
                    case 9:
                        RegistrationFee = 50;
                        break;
                    }



                    try
                    {
                        speakerId = repository.SaveSpeaker(this);
                    }
                    catch
                    {
                        throw new NoSessionsApprovedException("error al intentar grabar.");
                    }
                }
            }



            return(speakerId);
        }