Exemplo n.º 1
0
 public Person(string currZone)
 {
     ZoneID = currZone;
     Age = Age.EighteenToTwentyFive;
     Sex = Sex.Male;
     EducationLevel = EducationLevel.primary;
     household = new Household();
     Occupation = Occupation.TradesProfessional;
     PublicTransitPass = PublicTransitPass.MetroPass;
     EmploymentStatus = EmploymentStatus.PartTime;
     DrivingLicense = DrivingLicense.No;
     Type = AgentType.Person;
     myID = idCounter++;
 }
Exemplo n.º 2
0
 private Person(Person original)
 {
     Type = AgentType.Person;
     //copy the values
     ZoneID = original.ZoneID;
     Age = original.Age;
     Sex = original.Sex;
     EducationLevel = original.EducationLevel;
     Occupation = original.Occupation;
     PublicTransitPass = original.PublicTransitPass;
     EmploymentStatus = original.EmploymentStatus;
     DrivingLicense = original.DrivingLicense;
     household = original.household;
     myID = idCounter++;
 }
Exemplo n.º 3
0
        public Applicant(string firstName, string surname, string email, string phone, string line1, string line2, string city, string county, string eircode, string ppsNumber, EmploymentStatus employmentStatus, decimal weeklyNetPay, decimal weeklyOutgoings)
        {
            FirstName = firstName;
            Surname = surname;
            Email = email;
            Phone = phone;
            AddressLine1 = line1;
            AddressLine2 = line2;
            City = city;
            County = county;
            Eircode = eircode;
            PPSNumber = ppsNumber;
            EmploymentStatus = employmentStatus;
            WeeklyNetPay = weeklyNetPay;
            WeeklyOutgoings = weeklyOutgoings;

        }
        private void SetEmploymentPlaceLabel(EmploymentStatus value)
        {
            switch (value?.Name.ToLower())
            {
            case "zaposlen":
                EmploymentPlaceLabel = "Firma";
                break;

            case "student":
            case "učenik":
                EmploymentPlaceLabel = "Škola";
                break;

            case "predškolarac":
                EmploymentPlaceLabel = "Vrtić";
                break;

            default:
                EmploymentPlaceLabel = string.Empty;
                break;
            }

            IsEmploymentPlaceEnabled = !string.IsNullOrWhiteSpace(EmploymentPlaceLabel);
        }
Exemplo n.º 5
0
        //"StarSI" type="bh:AdmissionStarSIDef" minOccurs="0"/>
        //"FamilyReunification" type="bh:AdmissionFamilyReunificationDef" minOccurs="0"/>
        //"WomensProgram" type="bh:AdmissionWomensProgramDef" minOccurs="0"/>
        //"PayingBoard" type="bh:BoardNumberDef" minOccurs="1" maxOccurs="unbounded"/>
        //"GAF" type="integer" minOccurs="0" maxOccurs="1"/>
        //"MHSecondary" type="bh:AddMHSecondaryDef" minOccurs="0" maxOccurs="1"/>

        public void Initialize()
        {
            DateOfFirstContact       = DateTime.Now.Date.AddMonths(-5);
            AdmissionDate            = DateOfFirstContact.AddDays(1);
            CompletelyPaidByMedicaid = false;
            LevelOfCare = new LevelOfCare();
            //"NotConsistentWithAssessment" type="bh:NotConsistentWithAssessmentDef" minOccurs="0"/>
            //"GamblingDisorderScreen" type="boolean" minOccurs="0"/>
            //"GamblingDisorderAssessment" type="boolean" minOccurs="0"/>
            //"ProviderEpisodeNumber" type="bh:ProviderEpisodeNumberDef" minOccurs="0"/>
            ReferredBy                 = new ReferredBy();
            MaritalStatus              = new MaritalStatus();
            EducationLevel             = new EducationLevel();
            EducationEnrollment        = new EducationEnrollment();
            EmploymentStatus           = new EmploymentStatus();
            SourceOfIncomeSupport      = new SourceOfIncomeSupport();
            LivingArrangement          = new LivingArrangement();
            PriorAODTxtEpisodes        = new PriorAODTxtEpisodes();
            MentalHealthHistory        = true;
            Diagnoses                  = new Diagnoses();
            OpioidReplacementTherapy   = new OpioidReplacementTherapy();
            NumberOfChildrenUnder18    = 2;
            SpecialPopulation          = new SpecialPopulation();
            ChildBirthWithinLast5Years = true;
            NumberOfBirths             = 0;
            ClientPregnant             = false;
            StageOfPregnancy           = new StageOfPregnancy();
            MilitaryStatus             = new MilitaryStatus();
            ServedInIraq               = false;
            ServedInAfghanistan        = false;
            AlcoholAgeOfFirstIntox     = 15;
            DrugUse = new DrugUse();
            NumberOfArrestsPast30Days = 0;
            Reimbursement             = new Reimbursement();
            SelfHelp = new SelfHelp();
        }
Exemplo n.º 6
0
        //private List<Employee> GetEmployeesFiltered(string query)
        //{

        //    EmployeeListRequest req = new EmployeeListRequest();
        //    req.DepartmentId = "0";
        //    req.BranchId = "0";
        //    req.IncludeIsInactive = 2;
        //    req.SortBy = GetNameFormat();

        //    req.StartAt = "0";
        //    req.Size = "20";
        //    req.Filter = query;



        //    ListResponse<Employee> response = _employeeService.GetAll<Employee>(req);
        //    return response.Items;
        //}

        #region combobox dynamic insert



        protected void addStatus(object sender, DirectEventArgs e)
        {
            EmploymentStatus dept = new EmploymentStatus();
            //dept.name = statusId.Text;

            PostRequest <EmploymentStatus> depReq = new PostRequest <EmploymentStatus>();

            depReq.entity = dept;

            PostResponse <EmploymentStatus> response = _employeeService.ChildAddOrUpdate <EmploymentStatus>(depReq);

            if (response.Success)
            {
                dept.recordId = response.recordId;
                //  FillEHStatus();
                // statusId.Select(dept.recordId);
            }
            else
            {
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(response);
                return;
            }
        }
Exemplo n.º 7
0
        private void LoadJobTypeDisribution()
        {
            JobTypeRates = SparseTwinIndex <float> .CreateSimilarArray(Root.ZoneSystem.ZoneArray, EmploymentStatus);

            var employmentIndexes = EmploymentStatus.ValidIndexies().ToArray();

            using (CsvReader reader = new CsvReader(GetFullPath(JobEmploymentRateFile)))
            {
                int   pd;
                float fulltime;
                float parttime;
                if (JobEmploymentRateFileHeader)
                {
                    reader.LoadLine();
                }
                while (!reader.EndOfFile)
                {
                    var length = reader.LoadLine();
                    if (length >= 3)
                    {
                        reader.Get(out pd, 0);
                        reader.Get(out fulltime, 1);
                        reader.Get(out parttime, 2);
                        List <int> zones;
                        if (PDZoneMap.TryGetValue(pd, out zones))
                        {
                            foreach (var zone in zones)
                            {
                                this.JobTypeRates[zone, employmentIndexes[1]] = fulltime;
                                this.JobTypeRates[zone, employmentIndexes[2]] = parttime;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 8
0
        public Employee ParseToDataModel()
        {
            var employee = new Employee()
            {
                Firstname  = this.Firstname,
                Middlename = this.Middlename,
                Lastname   = this.Lastname,
                Gender     = this.Gender,
                Birthdate  = this.Birthdate,
                Age        = this._age,
                DateOfHire = DateTime.Now
            };

            var status = new EmploymentStatus()
            {
                Designation          = this.Designation,
                BasicSalary          = this.Salary,
                EmploymentAssignment = this.EmploymentAssignment
            };

            employee.EmploymentStatus.Add(status);

            return(employee);
        }
Exemplo n.º 9
0
        private void LoadJobTypeDisribution()
        {
            JobTypeRates = SparseTwinIndex <float> .CreateSimilarArray(Root.ZoneSystem.ZoneArray, EmploymentStatus);

            var employmentIndexes = EmploymentStatus.ValidIndexies().ToArray();

            using (CommentedCsvReader reader = new CommentedCsvReader(JobEmploymentRateFile.GetFileName(Root.InputBaseDirectory)))
            {
                while (reader.NextLine())
                {
                    if (reader.NumberOfCurrentCells >= 3)
                    {
                        reader.Get(out int pd, 0);
                        reader.Get(out float fulltime, 1);
                        reader.Get(out float parttime, 2);
                        foreach (var zone in PDZoneMap[pd])
                        {
                            JobTypeRates[zone, employmentIndexes[1]] = fulltime;
                            JobTypeRates[zone, employmentIndexes[2]] = parttime;
                        }
                    }
                }
            }
        }
Exemplo n.º 10
0
        public static LoanApplicationCoreStateObject GetBorrowerWithAllStipsButIDVerification(RegisterBorrowerRequest borrower, string employerAddress1, string employerAddress2, string employerCity, string employerState, string employerZipCode,
                                                                                              string currentEmployer, int lengthYears, string phoneNumber, string phoneExtension, string jobTitle, DateTime startDate, EmploymentStatus status)
        {
            var statusClient  = new LoanApplicationStatusClient();
            var filePath      = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Resources\\";
            var fileName      = "logo.jpg";
            var borrowerState = RegisterBorrower(borrower);

            borrowerState = GetPrimaryOffer(borrowerState.Borrower, (Guid)borrowerState.LoanApplicationGuid, borrowerState.BorrowerGuid.ToString());
            var employmentUpdate = CoreModelConstructors.CreateUpdateEmploymentRequestAuto();

            EmploymentInformation(employmentUpdate, (Guid)borrowerState.BorrowerGuid);
            borrowerState.LoanApplicationStipsCompleted++;
            var statusNoContent = statusClient.UpdateStatusJob();

            //ID
            EmailVerification(borrowerState.BorrowerGuid.ToString(), borrowerState.Borrower.Borrower.EmailAddress);
            var request = CoreModelConstructors.CreateCoreLinkBankAccountRequest("wells", (Guid)borrowerState.LoanApplicationGuid, "plaid_test", "plaid_good", PIEPER_JONES.Common.Enums.BankProvider.Plaid);

            statusNoContent = statusClient.UpdateStatusJob();
            IncomeVerification(borrowerState.LoanApplicationGuid.ToString(), filePath, fileName, null);
            borrowerState.LoanApplicationStipsCompleted++;
            statusNoContent = statusClient.UpdateStatusJob();
            BankStatementVerification(borrowerState.LoanApplicationGuid.ToString(), filePath, fileName, null);
            borrowerState.LoanApplicationStipsCompleted++;
            statusNoContent = statusClient.UpdateStatusJob();
            UpdateHomePayment(1700, GetRandomEnumValue <OccupancyStatus>(), borrowerState.BorrowerGuid.ToString());
            borrowerState.LoanApplicationStipsCompleted++;
            //Get all of these updated via the "batch job"
            statusNoContent = statusClient.UpdateStatusJob();
            return(borrowerState);
        }
Exemplo n.º 11
0
        public static LoanApplicationCoreStateObject GetBorrowerWithAllStipsButEmailAndBankverificationAuto(RegisterBorrowerRequest borrower, string address1, string address2, string city, string state, string zipCode, string currentEmployer, int lengthYears, string phoneNumber, string extension, string jobTitle, DateTime startDate, EmploymentStatus status)
        {
            var statusClient  = new LoanApplicationStatusClient();
            var filePath      = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Resources\\";
            var borrowerState = RegisterBorrower(borrower);

            borrowerState = GetPrimaryOffer(borrowerState.Borrower, (Guid)borrowerState.LoanApplicationGuid, borrowerState.BorrowerGuid.ToString());
            var employmentUpdate = CoreModelConstructors.CreateUpdateEmploymentRequestAuto();

            EmploymentInformation(employmentUpdate, (Guid)borrowerState.BorrowerGuid);
            borrowerState.LoanApplicationStipsCompleted++;
            var statusNoContent = statusClient.UpdateStatusJob();

            IdentityVerification(borrowerState.LoanApplicationGuid.ToString(), filePath, "PhotoID.pdf", null);
            borrowerState.LoanApplicationStipsCompleted++;
            statusNoContent = statusClient.UpdateStatusJob();
            IncomeVerification(borrowerState.LoanApplicationGuid.ToString(), filePath, "W2.pdf", null);
            borrowerState.LoanApplicationStipsCompleted++;
            statusNoContent = statusClient.UpdateStatusJob();
            BankStatementVerification(borrowerState.LoanApplicationGuid.ToString(), filePath, "BankStatement.pdf", null);
            borrowerState.LoanApplicationStipsCompleted++;
            statusNoContent = statusClient.UpdateStatusJob();
            UpdateHomePayment(1700, GetRandomEnumValue <OccupancyStatus>(), borrowerState.BorrowerGuid.ToString());
            borrowerState.LoanApplicationStipsCompleted++;
            //Get all of these updated via the "batch job"
            statusNoContent = statusClient.UpdateStatusJob();
            return(borrowerState);
        }
 public void ValidateEmploymentStatusOnUpdate(EmploymentStatus employmentStatus)
 {
     ValidateEmploymentStatus(employmentStatus);
     ValidateEmploymentStatusStrings(employmentStatus);
 }
Exemplo n.º 13
0
 private DbUpdateStatement GetQuery_UpdateQuery(EmploymentStatus _obj)
 {
     return(DbMgr.CreateUpdateClause("EmploymentStatus", GetFields(_obj), "EmploymentStatusID", _obj.EmploymentStatusID));
 }
Exemplo n.º 14
0
        public List <MonthlyBilling> selectAllFrom(DateTime?nullable)
        {
            List <MonthlyBilling> mb     = new List <MonthlyBilling>();
            MonthlyBilling        mb1    = new MonthlyBilling();
            MonthlyBilling        mb2    = new MonthlyBilling();
            MonthlyBillingPerPa   mbppa1 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa2 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa3 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa4 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa5 = new MonthlyBillingPerPa();

            mb1.Month = 6;
            mb1.Year  = 2015;

            mb2.Month = 5;
            mb2.Year  = 2015;
            EffortEntry e1 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Hansi", "Müller", new Adress("Teststrasse", 2, 2323, "City"))), new PersonalAssistant(new Person("Elisabeth", "Schütz", new Adress("Hausstrasse", 12, 3445, "Linz"))), new DateTime(2011, 5, 6), new DateTime(2012, 7, 7), 22);

            EffortEntry e2 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Lisa", "Bauer", new Adress("Hochstrasse", 34, 7654, "Town"))), new PersonalAssistant(new Person("Hans", "Kunz", new Adress("testtest", 87, 6354, "Enns"))), new DateTime(2013, 5, 6), new DateTime(2015, 7, 7), 242);


            EffortEntry e3 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Thomas", "Mann", new Adress("Klammstrasse", 2, 2323, "City"))), new PersonalAssistant(new Person("Uwe", "Lamm", new Adress("Hausstrasse", 12, 1234, "Steyr"))), new DateTime(2011, 5, 6), new DateTime(2012, 7, 7), 22);

            EffortEntry e4 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Tom", "Bauer", new Adress("Friedlstrasse", 344, 9876, "Hall"))), new PersonalAssistant(new Person("Julia", "Niedermaier", new Adress("Lastenstrasse", 56, 6354, "Wels"))), new DateTime(2013, 5, 6), new DateTime(2015, 7, 7), 242);

            e1.A1      = new Activity();
            e1.A2      = new Activity();
            e1.A3      = new Activity();
            e1.A1.Name = new Activity.State();
            e1.A2.Name = new Activity.State();
            e1.A3.Name = new Activity.State();
            e1.A1.Name = Activity.State.Nachtbereitschaft;
            e1.A2.Name = Activity.State.Grundversorgung;
            e1.A3.Name = Activity.State.Begleitung;
            e1.Day     = 1;
            e1.Month   = 2;
            e1.Year    = 2015;
            e1.From    = new DateTime(2015, 2, 1, 10, 23, 00);

            e1.To = new DateTime(2015, 2, 1, 20, 00, 00);

            e1.Km = 15;

            e2.A1      = new Activity();
            e2.A2      = new Activity();
            e2.A1.Name = new Activity.State();
            e2.A2.Name = new Activity.State();
            e2.A1.Name = Activity.State.Begleitung;
            e2.A2.Name = Activity.State.Freizeitgestaltung;
            e2.Day     = 3;
            e2.Month   = 7;
            e2.Year    = 2015;
            e2.From    = new DateTime(2015, 7, 3, 6, 20, 00);
            e2.To      = new DateTime(2015, 7, 3, 6, 20, 00);

            e2.Km = 15;


            e3.A1      = new Activity();
            e3.A2      = new Activity();
            e3.A1.Name = new Activity.State();
            e3.A2.Name = new Activity.State();
            e3.A1.Name = Activity.State.Begleitung;
            e3.A2.Name = Activity.State.Freizeitgestaltung;
            e3.Day     = 3;
            e3.Month   = 7;
            e3.Year    = 2015;
            e3.From    = new DateTime();
            e3.From.AddHours(12);
            e3.From.AddMinutes(00);
            e3.To = new DateTime();
            e3.To.AddHours(15);
            e3.To.AddMinutes(00);
            e3.Km = 15;

            e4.A1      = new Activity();
            e4.A2      = new Activity();
            e4.A1.Name = new Activity.State();
            e4.A2.Name = new Activity.State();
            e4.A1.Name = Activity.State.Begleitung;
            e4.A2.Name = Activity.State.Freizeitgestaltung;
            e4.Day     = 3;
            e4.Month   = 7;
            e4.Year    = 2015;
            e4.From    = new DateTime(2015, 2, 1, 07, 25, 00);

            e4.To = new DateTime(2015, 2, 1, 16, 00, 00);

            e4.Km = 15;

            mbppa1.EffortList = new List <EffortEntry>();
            mbppa2.EffortList = new List <EffortEntry>();
            mbppa3.EffortList = new List <EffortEntry>();

            mbppa1.EffortList.Add(e2);
            mbppa1.EffortList.Add(e1);
            mbppa1.EffortList.Add(e4);

            mbppa2.EffortList.Add(e3);
            mbppa2.EffortList.Add(e4);

            mbppa1.BillableKm                  = 22;
            mbppa1.Pa                          = new PersonalAssistant(new Person("Franz", "Müller", new Adress("Sandl", 2, 2345, "Altstadt")));
            mbppa1.Pur                         = new PurchaserData();
            mbppa1.Pur.Purchaser.Active        = true;
            mbppa1.Pur.Purchaser.FirstName     = "Hugo";
            mbppa1.Pur.Purchaser.LastName      = "Huber";
            mbppa1.Pur.Purchaser.MobilePhone   = "982374283745";
            mbppa1.Pur.Purchaser.EntryDate     = new DateTime(2010, 12, 12);
            mbppa1.Pur.Purchaser.EMail         = "*****@*****.**";
            mbppa1.Pur.Purchaser.ApprovalBegin = new DateTime(2015, 01, 01);
            mbppa1.Pur.Purchaser.ApprovalEnd   = new DateTime(2015, 12, 31);
            mbppa1.Pur.Purchaser.ContactPerson = new Person("Maria", "Huber", new Adress("Hauptstrasse", 12, 4040, "Linz"));
            mbppa1.Pur.Purchaser.Employees     = new List <EmploymentStatus>();
            EmploymentStatus e0 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Brigitte", "Fritte",
                                                     new Adress("Landstrasse", 22, 4209, "Engerwitzdorf"))), mbppa1.Pur.Purchaser);
            EmploymentStatus e5 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Max", "Moritz",
                                                     new Adress("Maienweg", 22, 4209, "Engerwitzdorf"))), mbppa1.Pur.Purchaser);

            mbppa1.Pur.Purchaser.HomeAdress  = new Adress("Heimatstrasse", 124, 2345, "Wien");
            mbppa1.Pur.Purchaser.PhoneNumber = "28374937453987";

            mbppa1.Pur.Income      = 1500;
            mbppa1.Pur.InputIncome = 150;
            mbppa1.Pur.Month       = 6;
            mbppa1.Pur.Year        = 2015;

            mbppa1.Pur.TravellingAllowanceKM = (decimal)0.22;
            mbppa1.Pur.HourlyRate            = 20;
            mbppa1.Pur.HourlyRatePayoff      = (decimal)20.5;
            mbppa1.Pur.CareAllowanceMaximum  = 300;
            mbppa1.Pur.CareAllowance         = 2;
            mbppa1.Pur.AssistenceDemand      = 60;

            mbppa2.BillableKm                  = 34;
            mbppa2.Pa                          = new PersonalAssistant(new Person("Franz", "Müller", new Adress("Sandl", 2, 2345, "Altstadt")));
            mbppa2.Pur                         = new PurchaserData();
            mbppa2.Pur.Purchaser.Active        = true;
            mbppa2.Pur.Purchaser.FirstName     = "Hugo";
            mbppa2.Pur.Purchaser.LastName      = "Huber";
            mbppa2.Pur.Purchaser.MobilePhone   = "982374283745";
            mbppa2.Pur.Purchaser.EntryDate     = new DateTime(2010, 12, 12);
            mbppa2.Pur.Purchaser.EMail         = "*****@*****.**";
            mbppa2.Pur.Purchaser.ApprovalBegin = new DateTime(2015, 01, 01);
            mbppa2.Pur.Purchaser.ApprovalEnd   = new DateTime(2015, 12, 31);
            mbppa2.Pur.Purchaser.ContactPerson = new Person("Maria", "Huber", new Adress("Hauptstrasse", 12, 4040, "Linz"));
            mbppa2.Pur.Purchaser.Employees     = new List <EmploymentStatus>();
            EmploymentStatus e9 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Brigitte", "Fritte",
                                                     new Adress("Landstrasse", 22, 4209, "Engerwitzdorf"))), mbppa2.Pur.Purchaser);
            EmploymentStatus e7 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Max", "Moritz",
                                                     new Adress("Maienweg", 22, 4209, "Engerwitzdorf"))), mbppa2.Pur.Purchaser);

            mbppa2.Pur.Purchaser.HomeAdress  = new Adress("Heimatstrasse", 124, 2345, "Wien");
            mbppa2.Pur.Purchaser.PhoneNumber = "28374937453987";

            mbppa2.Pur.Income      = 1500;
            mbppa2.Pur.InputIncome = 150;
            mbppa2.Pur.Month       = 6;
            mbppa2.Pur.Year        = 2015;

            mbppa2.Pur.TravellingAllowanceKM = (decimal)0.22;
            mbppa2.Pur.HourlyRate            = 20;
            mbppa2.Pur.HourlyRatePayoff      = (decimal)20.5;
            mbppa2.Pur.CareAllowanceMaximum  = 300;
            mbppa2.Pur.CareAllowance         = 2;
            mbppa2.Pur.AssistenceDemand      = 60;

            mb1.MbPerPaList = new List <MonthlyBillingPerPa>();
            mb2.MbPerPaList = new List <MonthlyBillingPerPa>();

            mb1.MbPerPaList.Add(mbppa1);
            mb1.MbPerPaList.Add(mbppa2);

            mb2.MbPerPaList.Add(mbppa2);
            List <MonthlyBilling> list = new List <MonthlyBilling>();

            list.Add(mb1);
            list.Add(mb2);

            return(list);
        }
Exemplo n.º 15
0
 // method to filter applicants by employment status
 private void FilterApplicantsByEmploymentStatus(EmploymentStatus status)
 {
     try
     {
         BLLApplicantManager BLLMngr = new BLLApplicantManager();
         List<Applicant> ApplicantList = BLLMngr.CallGetListOfApplicants();
         ApplicantList = ApplicantList.Where((applicant) => applicant.EmploymentStatus == status).ToList();
         dgvMainFormLoans.Visible = false;
         dgvMainFormApplicant.Visible = true;
         dgvMainFormApplicant.DataSource = ApplicantList;
         ApplicantsInDGV = ApplicantList;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         throw;
     }
 }
Exemplo n.º 16
0
        public void LoadData()
        {
            Loaded = true;
            LoadPDZoneMap();
            LoadCategoryInformation();
            LoadAgeDist();
            LoadEmploymentDist();
            LoadOccupationDist();
            LoadStudentDist();
            LoadJobOccupationDistribution();
            LoadJobTypeDisribution();
            LoadDriversLicenseDistribution();
            LoadNumberOfCarsDistribution();
            if (SaveDataIntoZones)
            {
                var employmentStatusIndexes = EmploymentStatus.ValidIndexArray();
                var ageCategoryIndexes      = AgeCategories.ValidIndexArray();
                var zones = Root.ZoneSystem.ZoneArray.GetFlatData();
                Parallel.For(0, zones.Length, zone =>
                {
                    var z = zones[zone];
                    float generalworker       = 0;
                    float manufacturingworker = 0;
                    float professionalworker  = 0;
                    float salesWorker         = 0;
                    float generalJob          = 0;
                    float manufacturingJob    = 0;
                    float professionalJob     = 0;
                    float salesJob            = 0;
                    var occRates = OccupationRates[zone];
                    var empData  = EmploymentStatusRates[zone];
                    if (occRates != null && empData != null)
                    {
                        var pop = z.Population;
                        foreach (var age in ageCategoryIndexes)
                        {
                            var agePop = pop * AgeRates[zone, age];
                            foreach (var status in employmentStatusIndexes)
                            {
                                var statusPop        = agePop * empData[age, status];
                                professionalworker  += statusPop * occRates[age, status, 1];
                                generalworker       += statusPop * occRates[age, status, 2];
                                salesWorker         += statusPop * occRates[age, status, 3];
                                manufacturingworker += statusPop * occRates[age, status, 4];
                            }
                        }
                        foreach (var status in employmentStatusIndexes)
                        {
                            var statusJobPop  = z.Employment * JobTypeRates[zone, status];
                            professionalJob  += statusJobPop * JobOccupationRates[zone, status, 1];
                            generalJob       += statusJobPop * JobOccupationRates[zone, status, 2];
                            salesJob         += statusJobPop * JobOccupationRates[zone, status, 3];
                            manufacturingJob += statusJobPop * JobOccupationRates[zone, status, 4];
                        }
                    }
                    z.GeneralEmployment       = generalJob;
                    z.ManufacturingEmployment = manufacturingJob;
                    z.ProfessionalEmployment  = professionalJob;
                    z.RetailEmployment        = salesJob;

                    z.WorkGeneral       = generalworker;
                    z.WorkManufacturing = manufacturingworker;
                    z.WorkProfessional  = professionalworker;
                    z.WorkRetail        = salesWorker;
                });
            }
        }
Exemplo n.º 17
0
 public Composition(int adultCount, int dependantCount, EmploymentStatus employmentStatus)
 {
     AdultCount       = adultCount;
     DependantCount   = dependantCount;
     EmploymentStatus = employmentStatus;
 }
Exemplo n.º 18
0
        protected void SaveNewRecord(object sender, DirectEventArgs e)
        {
            //Getting the id to check if it is an Add or an edit as they are managed within the same form.


            string           obj = e.ExtraParams["values"];
            EmploymentStatus b   = JsonConvert.DeserializeObject <EmploymentStatus>(obj);

            string id = e.ExtraParams["id"];

            // Define the object to add or edit as null

            if (string.IsNullOrEmpty(id))
            {
                try
                {
                    //New Mode
                    //Step 1 : Fill The object and insert in the store
                    PostRequest <EmploymentStatus> request = new PostRequest <EmploymentStatus>();

                    request.entity = b;
                    PostResponse <EmploymentStatus> r = _employeeService.ChildAddOrUpdate <EmploymentStatus>(request);


                    //check if the insert failed
                    if (!r.Success)//it maybe be another condition
                    {
                        //Show an error saving...
                        X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                        Common.errorMessage(r);
                        return;
                    }
                    else
                    {
                        b.recordId = r.recordId;
                        //Add this record to the store
                        this.Store1.Insert(0, b);

                        //Display successful notification
                        Notification.Show(new NotificationConfig
                        {
                            Title = Resources.Common.Notification,
                            Icon  = Icon.Information,
                            Html  = Resources.Common.RecordSavingSucc
                        });

                        this.EditRecordWindow.Close();
                        RowSelectionModel sm = this.GridPanel1.GetSelectionModel() as RowSelectionModel;
                        sm.DeselectAll();
                        sm.Select(b.recordId.ToString());
                    }
                }
                catch (Exception ex)
                {
                    //Error exception displaying a messsage box
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorSavingRecord).Show();
                }
            }
            else
            {
                //Update Mode

                try
                {
                    //getting the id of the record
                    PostRequest <EmploymentStatus> request = new PostRequest <EmploymentStatus>();
                    request.entity = b;
                    PostResponse <EmploymentStatus> r = _employeeService.ChildAddOrUpdate <EmploymentStatus>(request);                      //Step 1 Selecting the object or building up the object for update purpose

                    //Step 2 : saving to store

                    //Step 3 :  Check if request fails
                    if (!r.Success)//it maybe another check
                    {
                        X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                        Common.errorMessage(r);
                        return;
                    }
                    else
                    {
                        ModelProxy record = this.Store1.GetById(id);
                        BasicInfoTab.UpdateRecord(record);
                        record.Commit();
                        Notification.Show(new NotificationConfig
                        {
                            Title = Resources.Common.Notification,
                            Icon  = Icon.Information,
                            Html  = Resources.Common.RecordUpdatedSucc
                        });
                        this.EditRecordWindow.Close();
                    }
                }
                catch (Exception ex)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorUpdatingRecord).Show();
                }
            }
        }
Exemplo n.º 19
0
        public async Task <IActionResult> Register(RegisterViewModel model, string returnUrl = null)
        {
            ViewData["ReturnUrl"] = returnUrl;
            if (ModelState.IsValid)
            {
                var orgId = Guid.NewGuid();

                Organisation newOrganisation = new Organisation()
                {
                    Id               = orgId,
                    OrganisationId   = orgId,
                    OrganisationName = model.OrganisationName
                };

                var user = new ApplicationUser {
                    UserName         = model.Email,
                    Email            = model.Email,
                    OrganisationId   = newOrganisation.Id,
                    OrganisationName = model.OrganisationName,
                    FirstName        = model.FirstName,
                    LastName         = model.LastName,
                    PhoneNumber      = model.PhoneNumber,
                    UserRole         = "Super Admin"
                };

                var            license      = _context.Licenses.Where(x => x.LicenseKey == model.LicenseKey).Include(x => x.BatchLK).FirstOrDefault();
                IdentityResult licenceError = new IdentityResult();


                if (license == null)
                {
                    StatusMessage             = "Error!. License Key is Invalid.";
                    ViewData["StatusMessage"] = StatusMessage;


                    return(View(model));
                }
                else if (license.UserId != Guid.Empty)
                {
                    StatusMessage             = "Error!. License Key has been used.";
                    ViewData["StatusMessage"] = StatusMessage;


                    return(View(model));
                }



                var result = await _userManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    await _userManager.AddToRoleAsync(user, "Super Admin");

                    license.UserEmail      = model.Email;
                    license.StartDate      = DateTime.Now;
                    license.UserId         = Guid.Parse(user.Id);
                    license.OrganisationId = newOrganisation.Id;
                    license.ExpiryDate     = DateTime.Now.AddDays(license.BatchLK.NoOfDays);


                    _context.Licenses.Update(license);
                    _context.SaveChanges();

                    //Create Organisation profile immediately a new user come on board via the registration page.

                    newOrganisation.RegistrarId = Guid.Parse(user.Id);

                    _context.Add(newOrganisation);
                    _context.SaveChanges();

                    JobTitle newJobTitle = new JobTitle()
                    {
                        Id             = Guid.NewGuid(),
                        JobTitleName   = "Admin",
                        Description    = "Admin",
                        Note           = "Admin",
                        OrganisationId = newOrganisation.Id
                    };

                    _context.Add(newJobTitle);
                    _context.SaveChanges();

                    Department newDepartment = new Department()
                    {
                        Id             = Guid.NewGuid(),
                        DepartmentName = "Admin",
                        Description    = "Admin",
                        OrganisationId = newOrganisation.Id
                    };

                    _context.Add(newDepartment);
                    _context.SaveChanges();


                    EmploymentStatus newEmploymentStatus = new EmploymentStatus()
                    {
                        Id = Guid.NewGuid(),
                        EmploymentStatusName = "Full Time",
                        Description          = "Full Time",
                        OrganisationId       = newOrganisation.Id
                    };

                    _context.Add(newEmploymentStatus);
                    _context.SaveChanges();


                    JobCategory newJobCategory = new JobCategory()
                    {
                        Id = Guid.NewGuid(),
                        JobCategoryName = "Admin",
                        Description     = "Admin",
                        OrganisationId  = newOrganisation.Id
                    };

                    _context.Add(newJobCategory);
                    _context.SaveChanges();



                    EmployeeDetail employeeDetail = new EmployeeDetail()
                    {
                        FirstName      = model.FirstName,
                        LastName       = model.LastName,
                        OrganisationId = newOrganisation.Id,
                        UserId         = newOrganisation.RegistrarId,
                        Email          = model.Email,
                    };

                    _context.Add(employeeDetail);
                    await _context.SaveChangesAsync();

                    Branch branch = new Branch()
                    {
                        Id             = Guid.NewGuid(),
                        BranchName     = "Headquarters",
                        OrganisationId = newOrganisation.Id,
                    };


                    Job employeeJon = new Job()
                    {
                        Id                 = Guid.NewGuid(),
                        BranchId           = branch.Id,
                        JobCategoryId      = newJobCategory.Id,
                        JobTitleId         = newJobTitle.Id,
                        DepartmentId       = newDepartment.Id,
                        EmploymentStatusId = newEmploymentStatus.Id,
                        OrganisationId     = newOrganisation.Id,
                        EmployeeDetailId   = employeeDetail.Id,
                        JoinedDate         = DateTime.Now,
                        StartDate          = DateTime.Now,
                    };


                    _context.Add(employeeJon);
                    _context.SaveChanges();


                    _context.Add(branch);
                    _context.SaveChanges();

                    _logger.LogInformation("User created a new account with password.");

                    var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);

                    var callbackUrl = Url.EmailConfirmationLink(user.Id, code, Request.Scheme);
                    await _emailSender.SendGridEmailConfrimationAsync(model.Email, "Confirmation", callbackUrl, model.FirstName);

                    await _signInManager.SignInAsync(user, isPersistent : false);

                    _logger.LogInformation("User created a new account with password.");

                    StatusMessage = "Account created. Kindly update organisation details. Thanks.";


                    return(RedirectToLocal(returnUrl));
                }
                AddErrors(result);
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
 public void OverrideGetSubmissionEvents(EmploymentStatus response, HttpStatusCode httpStatusCode = HttpStatusCode.OK)
 {
     SetupCall(DefaultGetEmploymentStatusEndPoint, httpStatusCode, response);
 }
 public void SetupGetEmploymentStatus(EmploymentStatus response, string empRef, string nino, DateTime?fromDate = null, DateTime?toDate = null, HttpStatusCode httpStatusCode = HttpStatusCode.OK)
 {
     SetupCall(GetEmploymentStatus(empRef, nino, fromDate, toDate), httpStatusCode, response);
 }
Exemplo n.º 22
0
        public Admission(int id, Client client, DateTime dateOfFirstContact, DateTime admissionDate, bool completelyPaidByMedicaid, LevelOfCare levelOfCare, ReferredBy referredBy, MaritalStatus maritalStatus, EducationLevel educationLevel, EducationEnrollment educationEnrollment, EmploymentStatus employmentStatus, SourceOfIncomeSupport sourceOfIncomeSupport, LivingArrangement livingArrangement, PriorAODTxtEpisodes priorAODTxtEpisodes, bool mentalHealthHistory, Diagnoses diagnoses, OpioidReplacementTherapy opioidReplacementTherapy, int numberOfChildrenUnder18, SpecialPopulation specialPopulation, bool childBirthWithinLast5Years, int numberOfBirths, bool clientPregnant, StageOfPregnancy stageOfPregnancy, MilitaryStatus militaryStatus, bool servedInIraq, bool servedInAfghanistan, int alcoholAgeOfFirstIntox, DrugUse drugUse, int numberOfArrestsPast30Days, Reimbursement reimbursement, SelfHelp selfHelp)
        {
            this.id = id;
            RaiseIfClientIsNull("Admission Client", client);
            RaiseIfTooOld("Date of First Contact", dateOfFirstContact, new DateTime(2000, 1, 1));
            RaiseIfTooOld("Admission Date", admissionDate, new DateTime(2000, 1, 1));
            RaiseIfDateTooEarly("Admission Date", admissionDate, "Date of First Contact", dateOfFirstContact);
            this.dateOfFirstContact       = dateOfFirstContact;
            this.admissionDate            = admissionDate;
            this.completelyPaidByMedicaid = completelyPaidByMedicaid;

            RaiseIfNull("Level of Care", levelOfCare);
            this.levelOfCare = levelOfCare;

            RaiseIfNull("Referred By", referredBy);
            this.referredBy = referredBy;

            RaiseIfNull("Marital Status", maritalStatus);
            this.maritalStatus = maritalStatus;

            RaiseIfNull("Education Level", educationLevel);
            this.educationLevel = educationLevel;

            RaiseIfNull("Education Enrollment", educationEnrollment);
            this.educationEnrollment = educationEnrollment;

            RaiseIfNull("Employment Status", employmentStatus);
            this.employmentStatus = employmentStatus;

            RaiseIfNull("Source of Income Support", sourceOfIncomeSupport);
            this.sourceOfIncomeSupport = sourceOfIncomeSupport;

            //RaiseIfNull("Living Arrangement", livingArrangement);
            this.livingArrangement = livingArrangement;

            //RaiseIfNull("Prior AOD Treatment Episodes", priorAODTxtEpisodes);
            this.priorAODTxtEpisodes = priorAODTxtEpisodes;

            //RaiseIfNull("", );
            this.mentalHealthHistory      = mentalHealthHistory;
            this.diagnoses                = diagnoses;
            this.opioidReplacementTherapy = opioidReplacementTherapy;

            RaiseIfNotInRange("Number of Children Under 18", numberOfChildrenUnder18, 0, 99);
            this.numberOfChildrenUnder18 = numberOfChildrenUnder18;

            this.specialPopulation = specialPopulation;

            RaiseIfChildbirthTrueAndClientIsMale("Childbirth Within Last 5 Years", childBirthWithinLast5Years, client.Gender);
            this.childBirthWithinLast5Years = childBirthWithinLast5Years;


            this.numberOfBirths         = numberOfBirths;
            this.clientPregnant         = clientPregnant;
            this.stageOfPregnancy       = stageOfPregnancy;
            this.militaryStatus         = militaryStatus;
            this.servedInIraq           = servedInIraq;
            this.servedInAfghanistan    = servedInAfghanistan;
            this.alcoholAgeOfFirstIntox = alcoholAgeOfFirstIntox;
            this.drugUse = drugUse;
            this.numberOfArrestsPast30Days = numberOfArrestsPast30Days;
            this.reimbursement             = reimbursement;
            this.selfHelp = selfHelp;
        }
        public async Task <IActionResult> UpdateEmploymentStatus(int EmploymentStatusId, EmploymentStatus employmentStatus)
        {
            try
            {
                var res = await _service.UpdateEmploymentStatus(EmploymentStatusId, employmentStatus);

                if (res != null)
                {
                    return(Ok(res));
                }
                return(StatusCode(StatusCodes.Status204NoContent));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 24
0
 public LoginDTO(int employeeId, string employeeName, EmployeeType employeeType, EmploymentStatus status, string department)
 {
     EmployeeId   = employeeId;
     EmployeeName = employeeName;
     EmployeeType = employeeType;
     Status       = status;
     Department   = department;
 }
Exemplo n.º 25
0
 public void SetEmploymentStatus(EmploymentStatus eStatus)
 {
     EmploymentStatus = eStatus;
 }
 public EmploymentStatusObjects SetEmploymentStatusComboBox(string employmentStatus)
 {
     EmploymentStatus.SetValue(employmentStatus);
     return(this);
 }
Exemplo n.º 27
0
        /// <summary>
        /// Auswahl der Auftraggeberdaten für einen bestimmten Auftraggeber in einem bestimmten Monat
        /// </summary>
        /// <param name="pur"></param>
        /// <returns></returns>
        ///
        public PurchaserData Select(PurchaserData purData)
        {
            NpgsqlConnection con = DB.DBConnector.GetConnection();
            Purchaser        pur = new Purchaser();

            pur.Id = purData.Purchaser.Id;
            NpgsqlCommand command = new NpgsqlCommand(null, con);

            command.CommandText = "select * from (((((Person p inner Join Auftraggeber ag On (p.PersonId=ag.Agid)) Left outer join Adresse adresse on " +
                                  "(p.adressId = adresse.Adressid)) left Outer Join Person kontakt on (ag.kontaktperson = kontakt.personid) ) left outer join Adresse " +
                                  "kontaktad on (kontakt.adressid = kontaktad.adressid))) left outer Join Auftraggeberdaten agDaten on (ag.agid = agDaten.agid)" +
                                  " where ag.agid =@id and agDaten.agDatenid IN((select max(agDatenid) from Auftraggeberdaten group by agid))";

            DB.DBConnector.AddToCommand("@id", NpgsqlTypes.NpgsqlDbType.Numeric, command, pur.Id);

            //using the Connection to get Datas

            try
            {
                NpgsqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {
                    if (!(reader.IsDBNull(1)))
                    {
                        pur.EMail = reader.GetString(1);
                    }
                    if (!(reader.IsDBNull(2)))
                    {
                        pur.FirstName = reader.GetString(2);
                    }
                    if (!(reader.IsDBNull(3)))
                    {
                        pur.LastName = reader.GetString(3);
                    }
                    if (!(reader.IsDBNull(4)))
                    {
                        pur.PhoneNumber = reader.GetString(4);
                    }
                    if (!(reader.IsDBNull(6)))
                    {
                        pur.MobilePhone = reader.GetString(6);
                    }
                    if (!(reader.IsDBNull(7)))
                    {
                        pur.IBAN = reader.GetString(7);
                    }
                    if (!(reader.IsDBNull(8)))
                    {
                        pur.BIC = reader.GetString(8);
                    }
                    if (!(reader.IsDBNull(9)))
                    {
                        pur.AccountHolder = reader.GetString(9);
                    }
                    if (!(reader.IsDBNull(10)))
                    {
                        pur.SVN = Convert.ToInt64(reader.GetDecimal(10));
                    }
                    if (!(reader.IsDBNull(11)))
                    {
                        pur.nationality = reader.GetString(11);
                    }
                    if (!(reader.IsDBNull(12)))
                    {
                        pur.InfoField = reader.GetString(12);
                    }
                    if (!(reader.IsDBNull(13)))
                    {
                        pur.Active = reader.GetBoolean(13);
                    }
                    if (!(reader.IsDBNull(14)))
                    {
                        pur.ApprovalBegin = reader.GetDateTime(14);
                    }
                    if (!(reader.IsDBNull(15)))
                    {
                        pur.ApprovalEnd = reader.GetDateTime(15);
                    }
                    if (!(reader.IsDBNull(16)))
                    {
                        pur.EntryDate = reader.GetDateTime(16);
                    } // 17 = AGid, 18 = kontaktperson id
                    if (!(reader.IsDBNull(19)))
                    {
                        pur.hasIntroCourse = reader.GetBoolean(19);
                    }
                    if (!(reader.IsDBNull(20)))
                    {
                        pur.hasContract = reader.GetBoolean(20);
                    }
                    if (!(reader.IsDBNull(21)))
                    {
                        pur.DistrictCommision = reader.GetString(21);
                    }
                    if (!(reader.IsDBNull(22)))
                    {
                        pur.HomeAdress          = new Adress();
                        pur.HomeAdress.AdressId = reader.GetInt32(22);
                        if (!(reader.IsDBNull(23)))
                        {
                            pur.HomeAdress.Street = reader.GetString(23);
                        }
                        if (!(reader.IsDBNull(24)))
                        {
                            pur.HomeAdress.City = reader.GetString(24);
                        }
                        if (!(reader.IsDBNull(25)))
                        {
                            pur.HomeAdress.Country = reader.GetString(25);
                        }
                        if (!(reader.IsDBNull(26)))
                        {
                            pur.HomeAdress.HouseNumber = reader.GetInt32(26);
                        }
                        if (!(reader.IsDBNull(27)))
                        {
                            pur.HomeAdress.StairNumber = reader.GetInt32(27);
                        }
                        if (!(reader.IsDBNull(28)))
                        {
                            pur.HomeAdress.Etage = reader.GetInt32(28);
                        }
                        if (!(reader.IsDBNull(29)))
                        {
                            pur.HomeAdress.ZipCode = reader.GetInt32(29);
                        }
                        if (!(reader.IsDBNull(30)))
                        {
                            pur.HomeAdress.DoorNumber = reader.GetInt32(30);
                        }
                    }
                    //kontaktperson
                    if (!(reader.IsDBNull(31)))
                    {
                        pur.ContactPerson    = new Person();
                        pur.ContactPerson.Id = reader.GetInt32(31);
                        if (!(reader.IsDBNull(32)))
                        {
                            pur.ContactPerson.EMail = reader.GetString(32);
                        }
                        if (!(reader.IsDBNull(33)))
                        {
                            pur.ContactPerson.FirstName = reader.GetString(33);
                        }
                        if (!(reader.IsDBNull(34)))
                        {
                            pur.ContactPerson.LastName = reader.GetString(34);
                        }
                        if (!(reader.IsDBNull(35)))
                        {
                            pur.ContactPerson.PhoneNumber = reader.GetString(35);
                        }
                        if (!(reader.IsDBNull(37)))
                        {
                            pur.ContactPerson.MobilePhone = reader.GetString(37);
                        }

                        if (!(reader.IsDBNull(43)))
                        {
                            pur.ContactPerson.InfoField = reader.GetString(43);
                        }
                        if (!(reader.IsDBNull(44)))
                        {
                            pur.ContactPerson.HomeAdress = new Adress();
                            if (!(reader.IsDBNull(45)))
                            {
                                pur.ContactPerson.HomeAdress.Street = reader.GetString(45);
                            }
                            if (!(reader.IsDBNull(46)))
                            {
                                pur.ContactPerson.HomeAdress.City = reader.GetString(46);
                            }
                            if (!(reader.IsDBNull(47)))
                            {
                                pur.ContactPerson.HomeAdress.Country = reader.GetString(47);
                            }
                            if (!(reader.IsDBNull(48)))
                            {
                                pur.ContactPerson.HomeAdress.HouseNumber = reader.GetInt32(48);
                            }
                            if (!(reader.IsDBNull(49)))
                            {
                                pur.ContactPerson.HomeAdress.StairNumber = reader.GetInt32(49);
                            }
                            if (!(reader.IsDBNull(50)))
                            {
                                pur.ContactPerson.HomeAdress.Etage = reader.GetInt32(50);
                            }
                            if (!(reader.IsDBNull(51)))
                            {
                                pur.ContactPerson.HomeAdress.ZipCode = reader.GetInt32(51);
                            }
                            if (!(reader.IsDBNull(52)))
                            {
                                pur.ContactPerson.HomeAdress.DoorNumber = reader.GetInt32(52);
                            }
                        }
                    }
                    purData.Purchaser = pur;
                    if (!(reader.IsDBNull(53)))
                    {
                        purData.TravellingAllowanceKM = reader.GetDecimal(53);
                    }
                    if (!(reader.IsDBNull(54)))
                    {
                        purData.HourlyRatePayoff = reader.GetDecimal(54);
                    }
                    if (!(reader.IsDBNull(55)))
                    {
                        purData.HourlyRate = reader.GetDecimal(55);
                    }
                    if (!(reader.IsDBNull(56)))
                    {
                        purData.InputIncome = reader.GetDecimal(56);
                    }
                    if (!(reader.IsDBNull(57)))
                    {
                        purData.Month = Convert.ToInt32(reader.GetDecimal(57));
                    }
                    if (!(reader.IsDBNull(58)))
                    {
                        purData.Year = Convert.ToInt32(reader.GetDecimal(58));
                    }
                    //59 = agid
                    if (!(reader.IsDBNull(60)))
                    {
                        purData.TravellingAllowance = reader.GetDecimal(60);
                    }
                    if (!(reader.IsDBNull(61)))
                    {
                        purData.AssistenceDemand = reader.GetInt32(61);
                    }
                    if (!(reader.IsDBNull(62)))
                    {
                        purData.CareAllowance = reader.GetInt32(62);
                    }
                    if (!(reader.IsDBNull(63)))
                    {
                        purData.Income = reader.GetDecimal(63);
                    }
                    //64 = agdatenid
                }

                purData.Purchaser.Employees = new List <EmploymentStatus>();
                reader.Close();
                command.CommandText = "select * from dienstverhaeltnis dienst inner join person p on (dienst.paid=p.personid) where dienst.agid=@id";
                DB.DBConnector.AddToCommand("@id", NpgsqlTypes.NpgsqlDbType.Numeric, command, pur.Id);
                reader = command.ExecuteReader();
                while (reader.Read())
                {
                    if (!(reader.IsDBNull(1)))
                    {
                        EmploymentStatus emp = new EmploymentStatus();
                        emp.Purchaser    = purData.Purchaser;
                        emp.Assistant    = new PersonalAssistant();
                        emp.Assistant.Id = reader.GetInt32(1);
                        if (!(reader.IsDBNull(5)))
                        {
                            emp.Assistant.FirstName = reader.GetString(5);
                        }
                        if (!(reader.IsDBNull(6)))
                        {
                            emp.Assistant.LastName = reader.GetString(6);
                        }
                        purData.Purchaser.Employees.Add(emp);
                    }
                }
            }


            catch (Exception e) { MessageBox.Show(e.Message.ToString(), "Error"); }
            con.Close();

            return(purData);
        }
Exemplo n.º 28
0
        private DbInsertStatement GetQuery_InsertQuery(EmploymentStatus _obj)
        {
            Dictionary <string, DbFieldEntry> fields = GetFields(_obj);

            return(DbMgr.CreateInsertClause("EmploymentStatus", fields));
        }
Exemplo n.º 29
0
        private void myradwizard_Next(object sender, NavigationButtonsEventArgs e)
        {
            if (this.myradwizard.SelectedPage == Page0) // Check if this is the desired page
            {
                if (LastName.Text == "")
                {
                    errormessage.Text = "Last Name cannot be empty";
                    LastName.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (FirstName.Text == "")
                {
                    errormessage.Text = "First Name cannot be empty";
                    FirstName.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (CityName.SelectedValue == null || PermanentCityName.SelectedValue == null)
                {
                    errormessage.Text        = "Please complete address";
                    myradwizard.SelectedPage = Page1;
                }
                else if (ContactPerson.Text == "")
                {
                    errormessage.Text = "Contact Person cannot be empty";
                    ContactPerson.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (ContactPhone.Text == "")
                {
                    errormessage.Text = "Contact Phone cannot be empty";
                    ContactPhone.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (ContactAddress.Text == "")
                {
                    errormessage.Text = "Contact Address cannot be empty";
                    ContactAddress.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (BirthDate.DateTimeText == "")
                {
                    errormessage.Text = "BirthDay cannot be empty";
                    BirthDate.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (CivilStatus.SelectedValue == null)
                {
                    errormessage.Text = "Please select Civil Status";
                    CivilStatus.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (Nationality.SelectedValue == null)
                {
                    errormessage.Text = "Please select Nationality";
                    Nationality.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (Religion.SelectedValue == null)
                {
                    errormessage.Text = "Please select Religion";
                    Religion.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (Sex.SelectedValue == null)
                {
                    errormessage.Text = "Please select Gender";
                    Sex.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (HireDate.DateTimeText == "")
                {
                    errormessage.Text = "Please select Hire Date";
                    HireDate.Focus();
                    myradwizard.SelectedPage = Page1;
                }

                else if (Department.SelectedValue == null)
                {
                    errormessage.Text = "Please select Department";
                    Department.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (Section.SelectedValue == null)
                {
                    errormessage.Text = "Please select Section";
                    Section.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (Position.SelectedValue == null)
                {
                    errormessage.Text = "Please select Position";
                    Position.Focus();
                    myradwizard.SelectedPage = Page1;
                }
                else if (EmploymentStatus.SelectedValue == null)
                {
                    errormessage.Text = "Please select Employee Status";
                    EmploymentStatus.Focus();
                    myradwizard.SelectedPage = Page1;
                }

                if (EmailAddress.Text.Length == 0)
                {
                }
                else
                {
                    if (!Regex.IsMatch(EmailAddress.Text, @"^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"))
                    {
                        errormessage.Text = "Please enter a valid email.";
                        EmailAddress.Select(0, EmailAddress.Text.Length);
                        EmailAddress.Focus();
                        myradwizard.SelectedPage = Page1;
                    }
                    else
                    {
                    }
                }
            }
        }
Exemplo n.º 30
0
 public void AddEmploymentStatus(EmploymentStatus status)
 {
     unitofWork.employmentStatus.Insert(status);
     unitofWork.Save();
 }