Exemplo n.º 1
0
 ///<summary>Inserts one Employer into the database.  Returns the new priKey.</summary>
 internal static long Insert(Employer employer)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         employer.EmployerNum=DbHelper.GetNextOracleKey("employer","EmployerNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(employer,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     employer.EmployerNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(employer,false);
     }
 }
Exemplo n.º 2
0
 ///<summary>Inserts one Employer into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Employer employer,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         employer.EmployerNum=ReplicationServers.GetKey("employer","EmployerNum");
     }
     string command="INSERT INTO employer (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="EmployerNum,";
     }
     command+="EmpName,Address,Address2,City,State,Zip,Phone) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(employer.EmployerNum)+",";
     }
     command+=
          "'"+POut.String(employer.EmpName)+"',"
         +"'"+POut.String(employer.Address)+"',"
         +"'"+POut.String(employer.Address2)+"',"
         +"'"+POut.String(employer.City)+"',"
         +"'"+POut.String(employer.State)+"',"
         +"'"+POut.String(employer.Zip)+"',"
         +"'"+POut.String(employer.Phone)+"')";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         employer.EmployerNum=Db.NonQ(command,true);
     }
     return employer.EmployerNum;
 }
    protected void SendForInterviewButton_Click(object sender, EventArgs e)
    {
        List<String> idList = new List<String>();

        CheckBox cb = new CheckBox();

        foreach (GridViewRow row in ApplicantsListGridView.Rows)
        {
            cb = (CheckBox)row.Cells[selectRow].Controls[0];
            if (cb.Checked)
            {
                idList.Add(((GridViewRow)cb.NamingContainer).Cells[0].Text);
            }
        }

        EmailModule myEmailModule = new EmailModule();
        Employer emailSender = new Employer();
        emailSender.sheduleAndCallForInterviews(idList, Request["pid"], StartingTimeTextBox.Text, DateTextBox.Text, VenueTextBox.Text);
        /*
        foreach (String applicantId in idList)
        {
            myEmailModule.sendEmailForInterview(applicantId, Request["pid"], "10.30AM", "06/06/2015", "Company Conference Hall");
        }
        */
    }
Exemplo n.º 4
0
 public static bool workMoreTime(Employer e,int amount)
 {
     if(e.getExperience()*11>amount){
         return true;
     }
     return false;
 }
Exemplo n.º 5
0
        public async Task AddEmployer(Employer employer, AuthorizedOfficial authorizedOfficial)
        {
            int[] testCOnsultantsIDs = new int[] { 1, 2, 3 };

            var document = new BsonDocument
            {
               // {"Consultant_id",1},
              
               {"Employer_ID",1},
               {"EmployeeName",employer.EmployeeName},
               {"EmployeePhone",employer.EmployeePhone},
               {"EmployeeAddress",employer.EmployeeAddress},
               {"TaxID",employer.TaxID},
               {"AuthorizedOfficial", new BsonDocument
                    {
                            {"FirstName",authorizedOfficial.FirstName},
                            {"LastName",authorizedOfficial.LastName},
                            {"Email",authorizedOfficial.Email},
                            {"PhoneNumber",authorizedOfficial.PhoneNumber}
                    }
               },             
               {"Consultants",new BsonArray
                    {
                            new BsonDocument { {"Consultant_id", 1}},
                            new BsonDocument { {"Consultant_id", 2}} 
                    }
               }
               };  
            

        }
    protected void Page_Load(object sender, EventArgs e)
    {
        LoginModule myLoginModule = new LoginModule();
        myLoginModule.checkLoginStatus();
        myLoginModule.checkPermission(1);
        WelcomeLabel.Text = myLoginModule.getFirstName((String)Session["userID"]);
        if (!IsPostBack)
        {
            try
            {

                Employer myEmployer = new Employer();
                //LoginModule myLoginModule = new LoginModule();
                String[] stringArray = myEmployer.getInfoToForm((String)Session["userID"]);
                fName.Text = stringArray[0]; mName.Text = stringArray[1]; lName.Text = stringArray[2];
                company.Text = stringArray[4];
                personalPhone.Text = stringArray[9];
                personalEmail.Text = stringArray[3];
                companyPhone.Text = stringArray[10];
                companyEmail.Text = stringArray[8];
                number.Text = stringArray[5];
                street.Text = stringArray[6];
                town.Text = stringArray[7];
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "showAlert", "showAlert();", true);
            }
        }
    }
        protected void CreateUser_Click(object sender, EventArgs e)
        {
            var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
            var signInManager = Context.GetOwinContext().Get<ApplicationSignInManager>();
            var user = new Employer()
            {
                Email = Email.Text,
                UserName = Server.HtmlEncode(UserName.Text),
                CompanyName = Server.HtmlEncode(CompanyName.Text),
                Avatar = GlobalConstants.DefaultAvatar
            };

            IdentityResult result = manager.Create(user, Password.Text);

            if (result.Succeeded)
            {
                manager.AddToRole(user.Id, Role);

                signInManager.SignIn(user, isPersistent: false, rememberBrowser: false);
                Notifier.Success("Registration was successful!");
                IdentityHelper.RedirectToReturnUrl(Request.QueryString["ReturnUrl"], Response);
            }
            else
            {
                Notifier.Error(result.Errors.FirstOrDefault());
            }
        }
Exemplo n.º 8
0
 public static void printEmployer(Employer e)
 {
     Console.WriteLine("Name: "+e.getName());
     Console.WriteLine("Level: "+e.getLevel());
     Console.WriteLine("Experience: "+e.getExperience());
     Console.WriteLine("Leader: "+e.getIsLeader());
 }
 protected void AdditionalInfoButton_Click(object sender, EventArgs e)
 {
     Employer myEmployer = new Employer();
     myEmployer.setUserID((String)Session["userID"]);
     myEmployer.setStrings(fName.Text, mName.Text, lName.Text, personalPhone.Text, personalEmail.Text, company.Text, number.Text, street.Text, town.Text, companyPhone.Text, companyEmail.Text);
     TextBox1.Text = myEmployer.addInfo();
     Response.Redirect("ManagerHomePage.aspx");
 }
        public IQueryable<Employer> UpdateProfileEmployer(Employer updatedUser)
        {
            this.employers.Update(updatedUser);
            this.employers.SaveChanges();

            return this.employers
                .All()
                .Where(r => r.Id == updatedUser.Id);
        }
Exemplo n.º 11
0
 public static void compareMonts(Employer e)
 {
     Console.WriteLine("Enter monts to compare: ");
     int montsToCompare=int.Parse(Console.ReadLine());
     if(workMoreTime(e,montsToCompare)==true){
         Console.WriteLine("employer work more the  "+montsToCompare+ "monts");
     }else{
         Console.WriteLine("employer work menos the "+montsToCompare+" monts");
     }
 }
Exemplo n.º 12
0
    /// <summary>Initializes the plugin using an existing repository</summary>
    /// <param name="employer">Employer used assess and employ the plugin types</param>
    /// <param name="repository">Repository in which plugins will be stored</param>
    public PluginHost(Employer employer, PluginRepository repository) {
      this.employer = employer;
      this.repository = repository;

      foreach(Assembly assembly in this.repository.LoadedAssemblies) {
        employAssemblyTypes(assembly);
      }

      this.repository.AssemblyLoaded += new AssemblyLoadEventHandler(assemblyLoadHandler);
    }
Exemplo n.º 13
0
 public static double getSalary(Employer e)
 {
     double salary=245.0;
     if(e.getLevel()==2){
         salary+=100;
     }
     if(e.getIsLeader()==true){
         salary+=245*.15;
     }
     return salary;
 }
Exemplo n.º 14
0
        public Employer selectEmployerById(Employer obj)
        {
            NewJobBankContext db = new NewJobBankContext();

            try
            {

                return db.Employers.SqlQuery("dbo.SelectEmployerById @EmployerId='" + obj.EmployerId.ToString() + "'").Single();
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Exemplo n.º 15
0
        public Boolean insertEmployer(Employer obj)
        {
            using (NewJobBankContext db = new NewJobBankContext())
            {
                try
                {
                    db.Employers.Add(obj);
                    db.SaveChanges();
                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }
Exemplo n.º 16
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<Employer> TableToList(DataTable table){
			List<Employer> retVal=new List<Employer>();
			Employer employer;
			for(int i=0;i<table.Rows.Count;i++) {
				employer=new Employer();
				employer.EmployerNum= PIn.Long  (table.Rows[i]["EmployerNum"].ToString());
				employer.EmpName    = PIn.String(table.Rows[i]["EmpName"].ToString());
				employer.Address    = PIn.String(table.Rows[i]["Address"].ToString());
				employer.Address2   = PIn.String(table.Rows[i]["Address2"].ToString());
				employer.City       = PIn.String(table.Rows[i]["City"].ToString());
				employer.State      = PIn.String(table.Rows[i]["State"].ToString());
				employer.Zip        = PIn.String(table.Rows[i]["Zip"].ToString());
				employer.Phone      = PIn.String(table.Rows[i]["Phone"].ToString());
				retVal.Add(employer);
			}
			return retVal;
		}
Exemplo n.º 17
0
 public static void Main(String []args)
 {
     Employer e=new Employer();
     Console.WriteLine("Enter fields for employer\nName: ");
     e.setName(Console.ReadLine());
     Console.WriteLine("Level: ");
     e.setLevel(int.Parse(Console.ReadLine()));
     Console.WriteLine("Experience: ");
     e.setExperience(int.Parse(Console.ReadLine()));
     Console.WriteLine("Is Leader?: (yes/no)");
     if(Console.ReadLine()=="yes"){
         e.setIsLeader(true);
     }else{
         e.setIsLeader(false);
     }
     printEmployer(e);
     Console.WriteLine("his salary is : "+getSalary(e));
     compareMonts(e);
     Console.ReadKey();
 }
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        try
        {
            //DateTime dt = (Calendar1.SelectedDate);
            //String format = "yyyy-MM-dd";
            // String dob = dt.ToString(format);
            Employer myEmployer = new Employer(); ;
            myEmployer.setStrings(fName.Text, mName.Text, lName.Text, personalPhone.Text, personalEmail.Text, companyPhone.Text, number.Text, street.Text, town.Text, company.Text, companyEmail.Text);

            //myCVModule.setUsername(fName.Text);
            myEmployer.setUserID((String)Session["userID"]);
            TextBox1.Text = myEmployer.UpdateInfo();
            if (TextBox1.Text.Equals("Non-returning query Successfully executed.Non-returning query Successfully executed.Non-returning query Successfully executed."))
            {
                Response.Redirect("ManagerHomePage.aspx");
            }
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "showAlert", "showAlert();", true);
        }
    }
Exemplo n.º 19
0
        public Boolean deleteEmployer(Employer obj)
        {
            using (NewJobBankContext db = new NewJobBankContext())
            {
                try
                {
                    Employer employer = db.Employers.SqlQuery("dbo.SelectEmployerById @EmployerId='" + obj.EmployerId.ToString() + "'").Single();

                    if (employer != null)
                    {
                        db.Employers.Remove(employer);
                        #region Database Submission

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }

                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }
Exemplo n.º 20
0
 public async Task <SignInResult> PasswordSignInAsync(Employer employer, string Password, bool IsPersistent, bool LockOutFalier) =>
 await _signInManager.PasswordSignInAsync(employer, Password, IsPersistent, LockOutFalier);
Exemplo n.º 21
0
 public void Update(Employer employer)
 {
     _context.Employers.Update(employer);
 }
Exemplo n.º 22
0
 public async Task AddAsync(Employer employer)
 {
     await _context.Employers.AddAsync(employer);
 }
Exemplo n.º 23
0
        public async Task <bool> UpdateEmployerProfile(EmployerProfileViewModel employer, string updaterId, string role)
        {
            try
            {
                if (employer.Id != null)
                {
                    switch (role)
                    {
                    case "employer":
                        Employer existingEmployer = (await _employerRepository.GetByIdAsync(employer.Id));
                        existingEmployer.CompanyContact  = employer.CompanyContact;
                        existingEmployer.PrimaryContact  = employer.PrimaryContact;
                        existingEmployer.ProfilePhoto    = employer.ProfilePhoto;
                        existingEmployer.ProfilePhotoUrl = employer.ProfilePhotoUrl;
                        existingEmployer.DisplayProfile  = employer.DisplayProfile;
                        existingEmployer.UpdatedBy       = updaterId;
                        existingEmployer.UpdatedOn       = DateTime.Now;

                        var newSkills = new List <UserSkill>();
                        foreach (var item in employer.Skills)
                        {
                            var skill = existingEmployer.Skills.SingleOrDefault(x => x.Id == item.Id);
                            if (skill == null)
                            {
                                skill = new UserSkill
                                {
                                    Id        = ObjectId.GenerateNewId().ToString(),
                                    IsDeleted = false
                                };
                            }
                            UpdateSkillFromView(item, skill);
                            newSkills.Add(skill);
                        }
                        existingEmployer.Skills = newSkills;

                        await _employerRepository.Update(existingEmployer);

                        break;

                    case "recruiter":
                        Recruiter existingRecruiter = (await _recruiterRepository.GetByIdAsync(employer.Id));
                        existingRecruiter.CompanyContact  = employer.CompanyContact;
                        existingRecruiter.PrimaryContact  = employer.PrimaryContact;
                        existingRecruiter.ProfilePhoto    = employer.ProfilePhoto;
                        existingRecruiter.ProfilePhotoUrl = employer.ProfilePhotoUrl;
                        existingRecruiter.DisplayProfile  = employer.DisplayProfile;
                        existingRecruiter.UpdatedBy       = updaterId;
                        existingRecruiter.UpdatedOn       = DateTime.Now;

                        var newRSkills = new List <UserSkill>();
                        foreach (var item in employer.Skills)
                        {
                            var skill = existingRecruiter.Skills.SingleOrDefault(x => x.Id == item.Id);
                            if (skill == null)
                            {
                                skill = new UserSkill
                                {
                                    Id        = ObjectId.GenerateNewId().ToString(),
                                    IsDeleted = false
                                };
                            }
                            UpdateSkillFromView(item, skill);
                            newRSkills.Add(skill);
                        }
                        existingRecruiter.Skills = newRSkills;
                        await _recruiterRepository.Update(existingRecruiter);

                        break;
                    }
                    return(true);
                }
                return(false);
            }
            catch (MongoException e)
            {
                return(false);
            }
        }
Exemplo n.º 24
0
 public int addEmployer(Employer _employer)
 {
     return(_employerRepository.Add(_employer).EmployerID);
 }
Exemplo n.º 25
0
 public Employee(Employer employer)
 {
     this.EmployerId = employer.Id;
 }
        public IActionResult About(int Id)
        {
            Employer employer = _context.Employers.Find(Id);

            return(View());
        }
 public void Insert(Employer entity)
 {
     employerRepository.Insert(entity);
 }
 public void Delete(Employer entity)
 {
     employerRepository.Delete(entity);
 }
Exemplo n.º 29
0
 public EmployerDto selectEmployerById(System.Guid EmployerId)
 {
     EmployerManager mgr = new EmployerManager();
     Employer obj = new Employer();
     obj.EmployerId = EmployerId;
     obj = mgr.selectEmployerById(obj);
     if (obj != null)
     {
         return EmployerDto.createEmployerDTO(obj);
     }
     else
     {
         return null;
     }
 }
Exemplo n.º 30
0
 public Profession(String title, int salary, int experience, Employer employer) {
    this.title = title;
    this.salary = salary;
    this.experience = experience;
    this.employer = employer;
 }
Exemplo n.º 31
0
 private void bMyProfile_Click(object sender, RoutedEventArgs e)
 {
     currentEmployerDetail = currentAuthorizatedEmployer;
     ShowerHider(CODE_PROFILE_DETAILS);
 }
Exemplo n.º 32
0
        public IActionResult About(Employer employer)
        {
            Employer theEmployer = context.Employers.Find(employer.Id);

            return(View());
        }
 public void Update(Employer entity)
 {
     employerRepository.Update(entity);
 }
Exemplo n.º 34
0
		///<summary>Updates one Employer in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
		public static bool Update(Employer employer,Employer oldEmployer){
			string command="";
			if(employer.EmpName != oldEmployer.EmpName) {
				if(command!=""){ command+=",";}
				command+="EmpName = '"+POut.String(employer.EmpName)+"'";
			}
			if(employer.Address != oldEmployer.Address) {
				if(command!=""){ command+=",";}
				command+="Address = '"+POut.String(employer.Address)+"'";
			}
			if(employer.Address2 != oldEmployer.Address2) {
				if(command!=""){ command+=",";}
				command+="Address2 = '"+POut.String(employer.Address2)+"'";
			}
			if(employer.City != oldEmployer.City) {
				if(command!=""){ command+=",";}
				command+="City = '"+POut.String(employer.City)+"'";
			}
			if(employer.State != oldEmployer.State) {
				if(command!=""){ command+=",";}
				command+="State = '"+POut.String(employer.State)+"'";
			}
			if(employer.Zip != oldEmployer.Zip) {
				if(command!=""){ command+=",";}
				command+="Zip = '"+POut.String(employer.Zip)+"'";
			}
			if(employer.Phone != oldEmployer.Phone) {
				if(command!=""){ command+=",";}
				command+="Phone = '"+POut.String(employer.Phone)+"'";
			}
			if(command==""){
				return false;
			}
			command="UPDATE employer SET "+command
				+" WHERE EmployerNum = "+POut.Long(employer.EmployerNum);
			Db.NonQ(command);
			return true;
		}
Exemplo n.º 35
0
        ///<summary>Sends data for Patient.Cur to an export file and then launches an exe to notify PT.  If patient exists, this simply opens the patient.  If patient does not exist, then this triggers creation of the patient in PT Dental.  If isUpdate is true, then the export file and exe will have different names. In PT, update is a separate programlink with a separate button.</summary>
        public static void SendData(Program ProgramCur, Patient pat, bool isUpdate)
        {
            //ArrayList ForProgram=ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
            //ProgramProperty PPCur=ProgramProperties.GetCur(ForProgram, "InfoFile path");
            //string infoFile=PPCur.PropertyValue;
            if (!Directory.Exists(dir))
            {
                MessageBox.Show(dir + " does not exist.  PT Dental doesn't seem to be properly installed on this computer.");
                return;
            }
            if (pat == null)
            {
                MessageBox.Show("No patient is selected.");
                return;
            }
            if (!File.Exists(dir + "\\" + exportAddExe))
            {
                MessageBox.Show(dir + "\\" + exportAddExe + " does not exist.  PT Dental doesn't seem to be properly installed on this computer.");
                return;
            }
            if (!File.Exists(dir + "\\" + exportUpdateExe))
            {
                MessageBox.Show(dir + "\\" + exportUpdateExe + " does not exist.  PT Dental doesn't seem to be properly installed on this computer.");
                return;
            }
            string filename = dir + "\\" + exportAddCsv;

            if (isUpdate)
            {
                filename = dir + "\\" + exportUpdateCsv;
            }
            using (StreamWriter sw = new StreamWriter(filename, false)){               //overwrites if it already exists.
                sw.WriteLine("PAT_PK,PAT_LOGFK,PAT_LANFK,PAT_TITLE,PAT_FNAME,PAT_MI,PAT_LNAME,PAT_CALLED,PAT_ADDR1,PAT_ADDR2,PAT_CITY,PAT_ST,PAT_ZIP,PAT_HPHN,PAT_WPHN,PAT_EXT,PAT_FAX,PAT_PAGER,PAT_CELL,PAT_EMAIL,PAT_SEX,PAT_EDOCS,PAT_STATUS,PAT_TYPE,PAT_BIRTH,PAT_SSN,PAT_NOCALL,PAT_NOCORR,PAT_DISRES,PAT_LSTUPD,PAT_INSNM,PAT_INSGPL,PAT_INSAD1,PAT_INSAD2,PAT_INSCIT,PAT_INSST,PAT_INSZIP,PAT_INSPHN,PAT_INSEXT,PAT_INSCON,PAT_INSGNO,PAT_EMPNM,PAT_EMPAD1,PAT_EMPAD2,PAT_EMPCIT,PAT_EMPST,PAT_EMPZIP,PAT_EMPPHN,PAT_REFLNM,PAT_REFFNM,PAT_REFMI,PAT_REFPHN,PAT_REFEML,PAT_REFSPE,PAT_NOTES,PAT_FPSCAN,PAT_PREMED,PAT_MEDS,PAT_FTSTUD,PAT_PTSTUD,PAT_COLLEG,PAT_CHRTNO,PAT_OTHID,PAT_RESPRT,PAT_POLHLD,PAT_CUSCD,PAT_PMPID");
                sw.Write(",");                                                         //PAT_PK  Primary key. Long alphanumeric. We do not use.
                sw.Write(",");                                                         //PAT_LOGFK Internal PT logical, it can be ignored.
                sw.Write(",");                                                         //PAT_LANFK Internal PT logical, it can be ignored.
                sw.Write(",");                                                         //PAT_TITLE We do not have this field yet
                sw.Write(Tidy(pat.FName) + ",");                                       //PAT_FNAME
                sw.Write(Tidy(pat.MiddleI) + ",");                                     //PAT_MI
                sw.Write(Tidy(pat.LName) + ",");                                       //PAT_LNAME
                sw.Write(Tidy(pat.Preferred) + ",");                                   //PAT_CALLED Nickname
                sw.Write(Tidy(pat.Address) + ",");                                     //PAT_ADDR1
                sw.Write(Tidy(pat.Address2) + ",");                                    //PAT_ADDR2
                sw.Write(Tidy(pat.City) + ",");                                        //PAT_CITY
                sw.Write(Tidy(pat.State) + ",");                                       //PAT_ST
                sw.Write(Tidy(pat.Zip) + ",");                                         //PAT_ZIP
                sw.Write(TelephoneNumbers.FormatNumbersOnly(pat.HmPhone) + ",");       //PAT_HPHN No punct
                sw.Write(TelephoneNumbers.FormatNumbersOnly(pat.WkPhone) + ",");       //PAT_WPHN
                sw.Write(",");                                                         //PAT_EXT
                sw.Write(",");                                                         //PAT_FAX
                sw.Write(",");                                                         //PAT_PAGER
                sw.Write(TelephoneNumbers.FormatNumbersOnly(pat.WirelessPhone) + ","); //PAT_CELL
                sw.Write(Tidy(pat.Email) + ",");                                       //PAT_EMAIL
                if (pat.Gender == PatientGender.Female)
                {
                    sw.Write("Female");
                }
                else if (pat.Gender == PatientGender.Male)
                {
                    sw.Write("Male");
                }
                sw.Write(",");                            //PAT_SEX might be blank if unknown
                sw.Write(",");                            //PAT_EDOCS Internal PT logical, it can be ignored.
                sw.Write(pat.PatStatus.ToString() + ","); //PAT_STATUS Any text allowed
                sw.Write(pat.Position.ToString() + ",");  //PAT_TYPE Any text allowed
                if (pat.Birthdate.Year > 1880)
                {
                    sw.Write(pat.Birthdate.ToString("MM/dd/yyyy"));                    //PAT_BIRTH MM/dd/yyyy
                }
                sw.Write(",");
                sw.Write(Tidy(pat.SSN) + ",");              //PAT_SSN No punct
                if (pat.PreferContactMethod == ContactMethod.DoNotCall ||
                    pat.PreferConfirmMethod == ContactMethod.DoNotCall ||
                    pat.PreferRecallMethod == ContactMethod.DoNotCall)
                {
                    sw.Write("1");
                }
                sw.Write(",");                //PAT_NOCALL T if no call
                sw.Write(",");                //PAT_NOCORR No correspondence HIPAA
                sw.Write(",");                //PAT_DISRES Internal PT logical, it can be ignored.
                sw.Write(",");                //PAT_LSTUPD Internal PT logical, it can be ignored.
                List <PatPlan> patPlanList = PatPlans.Refresh(pat.PatNum);
                Family         fam         = Patients.GetFamily(pat.PatNum);
                List <InsSub>  subList     = InsSubs.RefreshForFam(fam);
                List <InsPlan> planList    = InsPlans.RefreshForSubList(subList);
                PatPlan        patplan     = null;
                InsSub         sub         = null;
                InsPlan        plan        = null;
                Carrier        carrier     = null;
                Employer       emp         = null;
                if (patPlanList.Count > 0)
                {
                    patplan = patPlanList[0];
                    sub     = InsSubs.GetSub(patplan.InsSubNum, subList);
                    plan    = InsPlans.GetPlan(sub.PlanNum, planList);
                    carrier = Carriers.GetCarrier(plan.CarrierNum);
                    if (plan.EmployerNum != 0)
                    {
                        emp = Employers.GetEmployer(plan.EmployerNum);
                    }
                }
                if (plan == null)
                {
                    sw.Write(",");                    //PAT_INSNM
                    sw.Write(",");                    //PAT_INSGPL Ins group plan name
                    sw.Write(",");                    //PAT_INSAD1
                    sw.Write(",");                    //PAT_INSAD2
                    sw.Write(",");                    //PAT_INSCIT
                    sw.Write(",");                    //PAT_INSST
                    sw.Write(",");                    //PAT_INSZIP
                    sw.Write(",");                    //PAT_INSPHN
                }
                else
                {
                    sw.Write(Tidy(carrier.CarrierName) + ",");                         //PAT_INSNM
                    sw.Write(Tidy(plan.GroupName) + ",");                              //PAT_INSGPL Ins group plan name
                    sw.Write(Tidy(carrier.Address) + ",");                             //PAT_INSAD1
                    sw.Write(Tidy(carrier.Address2) + ",");                            //PAT_INSAD2
                    sw.Write(Tidy(carrier.City) + ",");                                //PAT_INSCIT
                    sw.Write(Tidy(carrier.State) + ",");                               //PAT_INSST
                    sw.Write(Tidy(carrier.Zip) + ",");                                 //PAT_INSZIP
                    sw.Write(TelephoneNumbers.FormatNumbersOnly(carrier.Phone) + ","); //PAT_INSPHN
                }
                sw.Write(",");                                                         //PAT_INSEXT
                sw.Write(",");                                                         //PAT_INSCON Ins contact person
                if (plan == null)
                {
                    sw.Write(",");
                }
                else
                {
                    sw.Write(Tidy(plan.GroupNum) + ",");                  //PAT_INSGNO Ins group number
                }
                if (emp == null)
                {
                    sw.Write(",");                    //PAT_EMPNM
                }
                else
                {
                    sw.Write(Tidy(emp.EmpName) + ","); //PAT_EMPNM
                }
                sw.Write(",");                         //PAT_EMPAD1
                sw.Write(",");                         //PAT_EMPAD2
                sw.Write(",");                         //PAT_EMPCIT
                sw.Write(",");                         //PAT_EMPST
                sw.Write(",");                         //PAT_EMPZIP
                sw.Write(",");                         //PAT_EMPPHN

                /*we don't support employer info yet.
                 * sw.Write(Tidy(emp.Address)+",");//PAT_EMPAD1
                 * sw.Write(Tidy(emp.Address2)+",");//PAT_EMPAD2
                 * sw.Write(Tidy(emp.City)+",");//PAT_EMPCIT
                 * sw.Write(Tidy(emp.State)+",");//PAT_EMPST
                 * sw.Write(Tidy(emp.State)+",");//PAT_EMPZIP
                 * sw.Write(TelephoneNumbers.FormatNumbersOnly(emp.Phone)+",");//PAT_EMPPHN*/
                Referral referral = Referrals.GetReferralForPat(pat.PatNum);              //could be null
                if (referral == null)
                {
                    sw.Write(",");                    //PAT_REFLNM
                    sw.Write(",");                    //PAT_REFFNM
                    sw.Write(",");                    //PAT_REFMI
                    sw.Write(",");                    //PAT_REFPHN
                    sw.Write(",");                    //PAT_REFEML Referral source email
                    sw.Write(",");                    //PAT_REFSPE Referral specialty. Customizable, so any allowed
                }
                else
                {
                    sw.Write(Tidy(referral.LName) + ",");                //PAT_REFLNM
                    sw.Write(Tidy(referral.FName) + ",");                //PAT_REFFNM
                    sw.Write(Tidy(referral.MName) + ",");                //PAT_REFMI
                    sw.Write(referral.Telephone + ",");                  //PAT_REFPHN
                    sw.Write(Tidy(referral.EMail) + ",");                //PAT_REFEML Referral source email
                    if (referral.PatNum == 0 && !referral.NotPerson)     //not a patient, and is a person
                    {
                        sw.Write(referral.Specialty.ToString());
                    }
                    sw.Write(",");            //PAT_REFSPE Referral specialty. Customizable, so any allowed
                }
                sw.Write(",");                //PAT_NOTES No limits.  We won't use this right now for exports.
                //sw.Write(",");//PAT_NOTE1-PAT_NOTE10 skipped
                sw.Write(",");                //PAT_FPSCAN Internal PT logical, it can be ignored.
                if (pat.Premed)
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                        //PAT_PREMED F or T
                sw.Write(Tidy(pat.MedUrgNote) + ","); //PAT_MEDS The meds that they must premedicate with.
                if (pat.StudentStatus == "F")         //fulltime
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                //PAT_FTSTUD T/F
                if (pat.StudentStatus == "P") //parttime
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                         //PAT_PTSTUD
                sw.Write(Tidy(pat.SchoolName) + ",");  //PAT_COLLEG Name of college
                sw.Write(Tidy(pat.ChartNumber) + ","); //PAT_CHRTNO
                sw.Write(pat.PatNum.ToString() + ","); //PAT_OTHID The primary key in Open Dental ************IMPORTANT***************
                if (pat.PatNum == pat.Guarantor)
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                                    //PAT_RESPRT Responsible party checkbox T/F
                if (plan != null && pat.PatNum == sub.Subscriber) //if current patient is the subscriber on their primary plan
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");               //PAT_POLHLD Policy holder checkbox T/F
                sw.Write(",");               //PAT_CUSCD Web sync folder, used internally this can be ignored.
                sw.Write("");                //PAT_PMPID Practice Management Program ID. Can be ignored
                sw.WriteLine();
            }
            try{
                if (isUpdate)
                {
                    Process.Start(dir + "\\" + exportUpdateExe);                //already validated to exist
                }
                else
                {
                    Process.Start(dir + "\\" + exportAddExe);                //already validated to exist
                }
                //MessageBox.Show("done");
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 36
0
        /// <summary>
        /// Creating the roles for our application and adding the admin
        /// </summary>
        /// <returns></returns>
        private async Task CreateRolesandAdminUser(IServiceProvider serviceProvider)
        {
            // Getting the required services
            var mContext     = serviceProvider.GetService <ApplicationDbContext>();
            var mRoleManager = serviceProvider.GetService <RoleManager <IdentityRole> >();
            var mUserManager = serviceProvider.GetService <UserManager <ApplicationUser> >();

            // Check if we have the database ..
            if (mContext.Database.GetService <IRelationalDatabaseCreator>().Exists())
            {
                return;
            }

            // if note
            // Make sure that our database exist
            mContext.Database.EnsureCreated();

            // Check if the (Admin) role exist
            bool x = await mRoleManager.RoleExistsAsync("Admin");

            // If not
            if (!x)
            {
                // We make the (Admin) role
                await mRoleManager.CreateAsync(new IdentityRole()
                {
                    Name = "Admin"
                });

                // Making the admin user
                var user = new ApplicationUser();
                user.UserName = "******";
                user.Email    = "Admin@com";
                string userPWD = "AdminPassward";

                // Register the admin user
                IdentityResult chkUser = await mUserManager.CreateAsync(user, userPWD);

                // If the register succeed
                if (chkUser.Succeeded)
                {
                    // Give him the (Admin) role
                    var result1 = await mUserManager.AddToRoleAsync(user, "Admin");
                }
            }

            // Check if the (User) role exist
            x = await mRoleManager.RoleExistsAsync("User");

            // If not
            if (!x)
            {
                // Making the (User) role
                await mRoleManager.CreateAsync(new IdentityRole()
                {
                    Name = "User"
                });
            }

            // Check if the (Employer) role exist
            x = await mRoleManager.RoleExistsAsync("Employer");

            // If not
            if (!x)
            {
                // Making the (Employer) role
                await mRoleManager.CreateAsync(new IdentityRole()
                {
                    Name = "Employer"
                });
            }

            // Check if the (Student) role exist
            x = await mRoleManager.RoleExistsAsync("Student");

            // If not
            if (!x)
            {
                // Making the (Student) role
                await mRoleManager.CreateAsync(new IdentityRole()
                {
                    Name = "Student"
                });
            }


            #region Dummy Data

            // Adding dummy data
            await mUserManager.CreateAsync(new ApplicationUser()
            {
                UserName = "******", Email = "ST@com", IsVerified = true
            }, "st123456");

            var stUser = await mUserManager.FindByEmailAsync("ST@com");

            await mUserManager.AddToRoleAsync(stUser, "User");

            await mUserManager.AddToRoleAsync(stUser, "Student");

            var student = new Student()
            {
                User      = stUser,
                FirstName = "dummy",
                LastName  = "student",
                Age       = 22,
                City      = "Amman",
                Country   = "Jordan",
                Image     = "DefaultStudent.png",
                Major     = "IT",
                Skills    = new List <Skill>()
                {
                    new Skill()
                    {
                        SkillName = "C#"
                    },
                    new Skill()
                    {
                        SkillName = "MVC"
                    },
                    new Skill()
                    {
                        SkillName = "ASP.Net"
                    },
                }
            };

            mContext.Students.Add(student);

            await mUserManager.CreateAsync(new ApplicationUser()
            {
                UserName = "******", Email = "ET@com", IsVerified = true
            }, "et123456");

            var etUser = await mUserManager.FindByEmailAsync("ET@com");

            await mUserManager.AddToRoleAsync(etUser, "User");

            await mUserManager.AddToRoleAsync(etUser, "Employer");

            var employer = new Employer()
            {
                User         = etUser,
                Address      = "Amman",
                Describtion  = "For it porposses",
                EmployerName = "HTU Gaint",
                MobileNumber = "0000000000",
                Image        = "DefaultEmployers.png",
            };
            employer.Jobs = new List <Job>()
            {
                new Job()
                {
                    JobName    = "Jenior Develovor",
                    JobOwner   = employer,
                    MaxAge     = 50,
                    MinAge     = 18,
                    IsApproved = true,
                    IsExpired  = false,
                    Skills     = new List <Skill>()
                    {
                        new Skill()
                        {
                            SkillName = "MVC"
                        }
                    }
                },
                new Job()
                {
                    JobName    = "Jenior Designer",
                    JobOwner   = employer,
                    MaxAge     = 50,
                    MinAge     = 18,
                    IsApproved = true,
                    IsExpired  = false,
                    Skills     = new List <Skill>()
                    {
                        new Skill()
                        {
                            SkillName = "ASP.Net"
                        }
                    }
                }
            };

            mContext.Employers.Add(employer);

            mContext.Discussions.Add(new Discussion()
            {
                From        = stUser,
                To          = etUser,
                SendingDate = DateTime.Now,
                Message     = "Hello, Will you hire me, i'm more than enough for this job, you won't regret it...",
            });

            mContext.SaveChanges();

            #endregion
        }
Exemplo n.º 37
0
 public void AddEmployer(Employer employer)
 {
     selectedemployer = employer;
 }
Exemplo n.º 38
0
 public int updateEmployer(Employer _employer)
 {
     return(_employerRepository.Update(_employer));
 }
Exemplo n.º 39
0
 /// <summary>Initializes a plugin host using a new repository</summary>
 /// <param name="employer">Employer used assess and employ the plugin types</param>
 public PluginHost(Employer employer)
     : this(employer, new PluginRepository())
 {
 }
        public void ReturnExceptionWhenWorkNotConfirmedAsDoneByEmployerOnMakePaymentTest()
        {
            IMateDAO <Mate> MateDAO  = new MateDAO(_connection);
            Mate            testMate = new Mate();

            testMate.FirstName   = "Miguel";
            testMate.LastName    = "Dev";
            testMate.UserName    = "******";
            testMate.Password    = "******";
            testMate.Email       = "*****@*****.**";
            testMate.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
            testMate.Address     = "Figueiró";
            testMate.Categories  = new[] { Categories.CLEANING, Categories.PLUMBING };
            testMate.Rank        = Ranks.SUPER_MATE;
            testMate.Range       = 20;

            Mate returned = MateDAO.Create(testMate);

            IEmployerDAO <Employer> EmployerDAO = new EmployerDAO(_connection);
            Employer testEmployer = new Employer();

            testEmployer.FirstName   = "Marcelo";
            testEmployer.LastName    = "Carvalho";
            testEmployer.UserName    = "******";
            testEmployer.Password    = "******";
            testEmployer.Email       = "*****@*****.**";
            testEmployer.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
            testEmployer.Address     = "Lixa";

            Employer returnedEmp = EmployerDAO.Create(testEmployer);

            IJobDAO jobPostDAO = new JobDAO(_connection);
            JobPost testPost   = new JobPost();

            testPost.Title         = "Canalização Estourada";
            testPost.Category      = Categories.PLUMBING;
            testPost.ImagePath     = "path/image";
            testPost.Description   = "Grande estouro nos canos da sanita";
            testPost.Tradable      = false;
            testPost.InitialPrice  = 60.6;
            testPost.Address       = "Rua sem fim";
            testPost.PaymentMethod = new[] { Payment.PAYPAL, Payment.MONEY };

            JobPost jobReturned = jobPostDAO.Create(returnedEmp.Id, testPost);

            DateTime date = new DateTime(2020, 01, 16);
            Job      job  = new Job();

            job.Date    = date;
            job.Mate    = returned.Id;
            job.JobPost = jobReturned.Id;
            job.FinishedConfirmedByEmployer = false;
            job.FinishedConfirmedByMate     = false;
            job.Employer = returnedEmp.Id;

            IWorkDAO workDAO     = new WorkDAO(_connection);
            Job      returnedJob = workDAO.Create(returnedEmp.Id, job);

            workDAO.MarkJobAsDone(returnedJob.Id, returned.Id);

            Invoice invoice = new Invoice();

            invoice.Value       = 60.6;
            invoice.PaymentType = Payment.MONEY;

            PaymentDAO paymentDAO = new PaymentDAO(_connection);

            Assert.Throws <Exception>(() => paymentDAO.makePayment(invoice, returnedJob.Id, returnedEmp.Id));

            _fixture.Dispose();
        }
Exemplo n.º 41
0
        public void CanGetChatsTest()
        {
            IEmployerDAO <Employer> EmployerDAO = new EmployerDAO(_connection);
            Employer testEmployer = new Employer();

            testEmployer.FirstName   = "Marcelo";
            testEmployer.LastName    = "Carvalho";
            testEmployer.UserName    = "******";
            testEmployer.Password    = "******";
            testEmployer.Email       = "*****@*****.**";
            testEmployer.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
            testEmployer.Address     = "Lixa";

            Employer returned = EmployerDAO.Create(testEmployer);

            IMateDAO <Mate> MateDAO  = new MateDAO(_connection);
            Mate            testMate = new Mate();

            testMate.FirstName   = "Miguel";
            testMate.LastName    = "Dev";
            testMate.UserName    = "******";
            testMate.Password    = "******";
            testMate.Email       = "*****@*****.**";
            testMate.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
            testMate.Address     = "Figueiró";
            testMate.Categories  = new[] { Categories.CLEANING, Categories.PLUMBING };
            testMate.Rank        = Ranks.SUPER_MATE;
            testMate.Range       = 20;

            Mate returnedMate = MateDAO.Create(testMate);

            ChatDAO chatDao = new ChatDAO(_connection);

            int chatId  = chatDao.CreateChatId();
            int chatId2 = chatDao.CreateChatId();

            Chat chat = new Chat();

            chat.UserId = returned.Id;
            chat.ChatId = chatId;

            chatDao.CreateChat(chat);
            chat.UserId = returnedMate.Id;
            chatDao.CreateChat(chat);

            Chat chat2 = new Chat();

            chat2.UserId = returned.Id;
            chat2.ChatId = chatId2;

            chatDao.CreateChat(chat2);
            chat2.UserId = returnedMate.Id;
            chatDao.CreateChat(chat2);

            Chat[] user1ChatArray = chatDao.GetChats(returned.Id);
            Chat[] user2ChatArray = chatDao.GetChats(returnedMate.Id);

            Assert.Equal(2, user1ChatArray.Length);
            Assert.Equal(2, user2ChatArray.Length);

            Assert.Equal(chatId, user1ChatArray[0].ChatId);
            Assert.Equal(returnedMate.Id, user1ChatArray[0].UserId);
            Assert.Equal(chatId, user2ChatArray[0].ChatId);
            Assert.Equal(returned.Id, user2ChatArray[0].UserId);

            Assert.Equal(chatId2, user1ChatArray[1].ChatId);
            Assert.Equal(returnedMate.Id, user1ChatArray[1].UserId);
            Assert.Equal(chatId2, user2ChatArray[1].ChatId);
            Assert.Equal(returned.Id, user2ChatArray[1].UserId);

            _fixture.Dispose();
        }
Exemplo n.º 42
0
 public void Remove(Employer employer)
 {
     _context.Employers.Remove(employer);
 }
Exemplo n.º 43
0
        public IHttpActionResult UpdateEmployerSalary([FromUri] string firstName, string lastName, Employer employer)
        {
            var employerInDb = _unitOfWork.Employers.GetEmployer(firstName, lastName);

            if (employerInDb == null)
            {
                return(NotFound());
            }

            if (!employer.NetSalary.HasValue)
            {
                return(BadRequest());
            }

            employerInDb.NetSalary = employer.NetSalary;

            _unitOfWork.Comlete();

            return(Ok());
        }
        public IActionResult About(int id)
        {
            Employer theEmployer = context.Employers.Find(id);

            return(View(theEmployer));
        }
Exemplo n.º 45
0
 public static async Task InsertData(Employer employer)
 {
     db.Employers.Add(employer);
     await db.SaveChangesAsync();
 }
Exemplo n.º 46
0
 public async Task SignInAsync(Employer employer, bool isPersistent) =>
 await _signInManager.SignInAsync(employer, isPersistent);
Exemplo n.º 47
0
 public static async Task DeleteData(Employer employer)
 {
     db.Employers.Remove(employer);
     await db.SaveChangesAsync();
 }
Exemplo n.º 48
0
 public void LogOutUser()
 {
     currentAuthorizatedEmployer = null;
     client.Close();
     ShowerHider(CODE_LOG_OUT);
 }
Exemplo n.º 49
0
        public void CanFindWorkByIdTest()
        {
            IMateDAO <Mate> MateDAO  = new MateDAO(_connection);
            Mate            testMate = new Mate();

            testMate.FirstName   = "Miguel";
            testMate.LastName    = "Dev";
            testMate.UserName    = "******";
            testMate.Password    = "******";
            testMate.Email       = "*****@*****.**";
            testMate.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
            testMate.Address     = "Figueiró";
            testMate.Categories  = new[] { Categories.CLEANING, Categories.PLUMBING };
            testMate.Rank        = Ranks.SUPER_MATE;
            testMate.Range       = 20;

            Mate returned = MateDAO.Create(testMate);

            IEmployerDAO <Employer> EmployerDAO = new EmployerDAO(_connection);
            Employer testEmployer = new Employer();

            testEmployer.FirstName   = "Marcelo";
            testEmployer.LastName    = "Carvalho";
            testEmployer.UserName    = "******";
            testEmployer.Password    = "******";
            testEmployer.Email       = "*****@*****.**";
            testEmployer.Description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
            testEmployer.Address     = "Lixa";

            Employer returnedEmp = EmployerDAO.Create(testEmployer);

            IJobDAO jobPostDAO = new JobDAO(_connection);
            JobPost testPost   = new JobPost();

            testPost.Title         = "Canalização Estourada";
            testPost.Category      = Categories.PLUMBING;
            testPost.ImagePath     = "path/image";
            testPost.Description   = "Grande estouro nos canos da sanita";
            testPost.Tradable      = true;
            testPost.InitialPrice  = 60.6;
            testPost.Address       = "Rua sem fim";
            testPost.PaymentMethod = new[] { Payment.PAYPAL, Payment.MONEY };

            JobPost  jobReturned = jobPostDAO.Create(returnedEmp.Id, testPost);
            DateTime date        = new DateTime(2020, 01, 16);
            Job      job         = new Job();

            job.Date    = date;
            job.Mate    = returned.Id;
            job.JobPost = jobReturned.Id;
            job.FinishedConfirmedByEmployer = false;
            job.FinishedConfirmedByMate     = false;
            job.Employer = returnedEmp.Id;

            IWorkDAO         workDAO = new WorkDAO(_connection);
            Job              created = workDAO.Create(returnedEmp.Id, job);
            WorkDetailsModel found   = workDAO.FindById(created.Id);

            Assert.Equal(created.Date, found.Date);
            Assert.Equal(created.Mate, found.Mate.Id);
            Assert.Equal(created.JobPost, found.JobPost.Id);
            Assert.Equal(created.FinishedConfirmedByEmployer, found.FinishedConfirmedByEmployer);
            Assert.Equal(created.FinishedConfirmedByMate, found.FinishedConfirmedByMate);
            Assert.Equal(created.Employer, found.Employer.Id);

            _fixture.Dispose();
        }
Exemplo n.º 50
0
        protected string AmendAdvert(Employer employer, AmendAdvertRequestMessage request)
        {
            IAdvertPostService service = new AdvertPostService(employer.GetLoginId(), _jobAdsCommand, _jobAdsQuery, _jobAdIntegrationQuery, _externalJobAdsCommand, _locationQuery, _industriesQuery, _employersQuery, _loginCredentialsQuery, _serviceAuthenticationManager, _jobAdIntegrationReportsCommand);

            return(service.AmendAdvert(request).AmendAdvertResponse.Success);
        }
Exemplo n.º 51
0
 public SuperMiddleManager()
 {
     _employer = new Employer();
 }
Exemplo n.º 52
0
		///<summary>Updates one Employer in the database.</summary>
		public static void Update(Employer employer){
			string command="UPDATE employer SET "
				+"EmpName    = '"+POut.String(employer.EmpName)+"', "
				+"Address    = '"+POut.String(employer.Address)+"', "
				+"Address2   = '"+POut.String(employer.Address2)+"', "
				+"City       = '"+POut.String(employer.City)+"', "
				+"State      = '"+POut.String(employer.State)+"', "
				+"Zip        = '"+POut.String(employer.Zip)+"', "
				+"Phone      = '"+POut.String(employer.Phone)+"' "
				+"WHERE EmployerNum = "+POut.Long(employer.EmployerNum);
			Db.NonQ(command);
		}
Exemplo n.º 53
0
        protected override MemberAccessReason?PerformAction(bool isApplicant, CreditInfo creditInfo, bool isLoggedIn, Employer employer, Member[] members)
        {
            var url = GetDownloadUrl(members);

            if (!isLoggedIn)
            {
                Get(url);
                Assert.AreEqual(_loginUrl.Path.ToLower(), Browser.CurrentUrl.AbsolutePath.ToLower());
                return(null);
            }

            if (isApplicant || ((creditInfo.CanContact || creditInfo.HasUsedCredit) && !creditInfo.HasExpired))
            {
                using (var response = Download(url))
                {
                    return(AssertFile(response, employer, members));
                }
            }

            Get(url);
            AssertPageContains("You need " + (members.Length == 1 ? "1 credit" : members.Length + " credits") + " to perform this action but you have none available.");
            return(null);
        }
Exemplo n.º 54
0
 public IActionResult About(int id, Employer newEmployer)
 {
     return(View(newEmployer));
 }
Exemplo n.º 55
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            //Create a couple objects to compare
            Company company1 = new Company()
            {
                CompanyId               = 1,
                Name                    = "Levi9",
                EmployerTypeId          = 1,
                Industry                = "Informacione tehnologije",
                Address                 = "Trifkovicev trg 6, 21000 Novi Sad, Serbia",
                CityId                  = 1,
                VatNumber               = "1234567890",
                LandLineNumber          = "+381(0) 21 215 55 04",
                CompanyWebsite          = "www.levi9.com",
                NumberOfEmployees       = 1000,
                SalaryPayDayInMonth     = 1,
                BankInfoId              = 91,
                ProbationPeriodInMonths = 6
            };

            Company company2 = new Company()
            {
                CompanyId               = 2,
                Name                    = "Levi9",
                EmployerTypeId          = 1,
                Industry                = "Informacione tehnologije",
                Address                 = "Zorza Klemansoa br 19, 11000 Beograd, Serbia",
                CityId                  = 2,
                VatNumber               = "1234567890",
                LandLineNumber          = "+381 21 2155513",
                CompanyWebsite          = "www.levi9.com",
                NumberOfEmployees       = 1000,
                SalaryPayDayInMonth     = 1,
                BankInfoId              = 91,
                ProbationPeriodInMonths = 6
            };

            Person person1 = new Person()
            {
                PersonId             = 1,
                EmployerId           = 1,
                FirstName            = "Jan",
                Email                = "*****@*****.**",
                LastName             = "Dolinaj",
                Salutation           = "Mr",
                MobileNumber         = "",
                PreferredLanguageId  = 1,
                PersonStatusId       = 1,
                PersonRoleId         = 2,
                UserId               = Guid.NewGuid(),
                ValidFrom            = DateTime.Now,
                ValidTo              = DateTime.Now.AddYears(1),
                AuthyId              = "2",
                IsEmailValidated     = true,
                IsMobileValidated    = true,
                ModifiedBy           = null,
                PersonStatusChangeId = null
            };

            Person person2 = new Person()
            {
                PersonId             = 2,
                EmployerId           = 1,
                FirstName            = "Pien",
                Email                = "*****@*****.**",
                LastName             = "Oosterman",
                Salutation           = "Mrs",
                MobileNumber         = "",
                PreferredLanguageId  = 1,
                PersonStatusId       = 1,
                PersonRoleId         = 1,
                UserId               = Guid.NewGuid(),
                ValidFrom            = DateTime.Now,
                ValidTo              = DateTime.Now.AddYears(2),
                AuthyId              = "1",
                IsEmailValidated     = true,
                IsMobileValidated    = true,
                ModifiedBy           = null,
                PersonStatusChangeId = null
            };

            Employer employer1 = new Employer()
            {
                EmployerId                    = 1,
                CompanyId                     = 1,
                DateOfApplication             = DateTime.Now,
                LastScheduledBlackoutHappened = null,
                EmployerStatusId              = 1,
                ContactPersonId               = 1,
                PortfolioId                   = 1,
                FlexxCode                     = "FlexxCode 1",
                Currency       = "rsd",
                IsInBlackOut   = false,
                EnrollmentDate = DateTime.Now,
            };

            Employer employer2 = new Employer()
            {
                EmployerId                    = 2,
                CompanyId                     = 2,
                DateOfApplication             = DateTime.Now,
                LastScheduledBlackoutHappened = null,
                EmployerStatusId              = 1,
                ContactPersonId               = 2,
                PortfolioId                   = 2,
                FlexxCode                     = "FlexxCode 1",
                Currency       = "Euro",
                IsInBlackOut   = false,
                EnrollmentDate = DateTime.Now,
            };

            employer1.Company       = company1;
            employer1.ContactPerson = person1;
            employer1.Person.Add(person1);

            employer2.Company       = company2;
            employer2.ContactPerson = person2;
            employer2.Person.Add(person2);

            //This is the comparison class
            CompareLogic compareLogic = new CompareLogic();

            // explanation --> https://github.com/GregFinzer/Compare-Net-Objects/wiki/Getting-Started#important
            compareLogic.Config.MaxDifferences = 999;

            ComparisonResult result = compareLogic.Compare(employer1, employer2);

            if (!result.AreEqual)
            {
                Console.WriteLine(result.DifferencesString);
            }

            Console.ReadKey();
        }