Example #1
0
        private uint GetFreeRecordBookNumber(uint eduForm, bool paid, EducationLevel eduLevel)
        {
            var range   = _RecordBooksRanges.Single(s => s.Item1.Item1 == eduForm && s.Item1.Item2 == paid && (s.Item1.Item3 & eduLevel) != EducationLevel.NONE).Item2;
            var numbers = _DB_Connection.Select(
                DB_Table.ORDERS_HAS_APPLICATIONS,
                new string[] { "record_book_number" },
                new List <Tuple <string, Relation, object> >
            {
                new Tuple <string, Relation, object>("record_book_number", Relation.GREATER_EQUAL, range.Item1),
                new Tuple <string, Relation, object>("record_book_number", Relation.LESS_EQUAL, range.Item2)
            }).Select(s => (uint)s[0]);

            if (numbers.Any())
            {
                uint lastNumber = numbers.Max();
                if (lastNumber == range.Item2)
                {
                    throw new InvalidOperationException("Превышение границы диапазона номеров зачётных книжек.");
                }

                return(lastNumber + 1);
            }
            else
            {
                return(range.Item1);
            }
        }
Example #2
0
        /// <summary>
        /// Creates a user based on the user's input. Validation handled by jQuery.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnCreate_Click(object sender, EventArgs e)
        {
            // Get all inputs
            string         name  = TxtName.Text;
            string         email = TxtEmail.Text;
            string         phone = TxtPhone.Text;
            EducationLevel level = (EducationLevel)Enum.Parse(typeof(EducationLevel),
                                                              DDEducation.SelectedItem.ToString());
            string birthday = TxtBirthday.Text;
            string password = TxtPassword.Text;

            User user = null;

            if (string.IsNullOrEmpty(phone))
            {
                user = new User(name, email, level, birthday, password);
            }
            else
            {
                user = new User(name, email, phone, level, birthday, password);
            }

            UserTableDAO userDao = new UserTableDAO(ConfigurationManager.ConnectionStrings["flexiLearn"].ConnectionString);

            userDao.AddUser(user);

            LblSuccess.Text = "Account successfully created. <a href='login.aspx'>You may login here</a>.<br><br>";
        }
Example #3
0
    WorkPlace GetEmptyWorkSlotExtended(EducationLevel educationLevel, bool random = true) //See comments on GetEmptyWorkSlot()
    {
        if (workPlaces.Count < 1)
        {
            return(null);
        }

        List <WorkPlace> availableWorkPlaces = new List <WorkPlace>();

        foreach (WorkPlace workPlace in workPlaces)
        {
            if (workPlace.AvailableWorkerSlots() > 0 &&
                workPlace.WorkerEducationLevel() <= educationLevel)
            {
                if (!random)
                {
                    return(workPlace);
                }

                availableWorkPlaces.Add(workPlace);
            }
        }

        if (availableWorkPlaces.Count < 1)
        {
            return(null);
        }

        int randomInt = Random.Range(0, availableWorkPlaces.Count - 1);

        return(availableWorkPlaces[randomInt]);
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Roles.IsUserInRole(ConfigurationManager.AppSettings["jobseekerrolename"]))
        {
            Response.Redirect("~/customerrorpages/NotAuthorized.aspx");
        }

        if (!Page.IsPostBack)
        {
            int postingid;
            postingid = int.Parse(Request.QueryString["id"]);
            JobPosting p = JobPosting.GetPosting(postingid);
            lblCity.Text    = p.City;
            lblCompany.Text = Company.GetCompanyName(p.CompanyID);
            btnViewProfile.CommandArgument = p.CompanyID.ToString();
            lblContactPerson.Text          = p.ContactPerson;
            lblCountry.Text  = Country.GetCountryName(p.CountryID);
            lblDept.Text     = p.Department;
            lblDesc.Text     = p.Description;
            lblEduLevel.Text = EducationLevel.GetEducationLevelName(p.EducationLevelID);
            lblJobCode.Text  = p.JobCode;
            lblJobType.Text  = JobType.GetJobTypeName(p.JobTypeID);
            lblMaxSal.Text   = p.MaxSalary.ToString("C");
            lblMinSal.Text   = p.MinSalary.ToString("C");
            lblPostDt.Text   = p.PostingDate.ToShortDateString();
            lblState.Text    = State.GetStateName(p.StateID);
            lblTitle.Text    = p.Title;
        }
    }
        public ActionResult Edit(long id)
        {
            EducationLevel thisArea = _areaReposity.GetById(id);
            var            area     = Mapper.Map <EducationLevel, EducationLevelEditModel>(thisArea);

            return(View("Edit", area));
        }
Example #6
0
 public Person(string name, ushort age, EducationLevel education, Money income)
 {
     this.Name      = new Name(name);
     this.Age       = age;
     this.Education = education;
     this.Income    = income;
 }
Example #7
0
        private void ButtonAddEducationLevel_Click(object sender, RoutedEventArgs e)
        {
            AreButtonsEnabled = false;
            string name = TextBoxEducationLevelName.Text;

            if (string.IsNullOrEmpty(name) || string.IsNullOrWhiteSpace(name))
            {
                MessageBox.Show("Debe ingresar un nombre", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                AreButtonsEnabled = true;
                return;
            }

            EducationLevel educationLevel = new EducationLevel()
            {
                Name = name
            };

            App.DbContext.EducationLevels.Add(educationLevel);

            try
            {
                App.DbContext.SaveChanges();
            }
            catch
            {
                MessageBox.Show("No se pudieron guardar los cambios en la base de datos", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                AreButtonsEnabled = true;
                return;
            }

            MessageBox.Show("Escolaridad agregada con éxito", "Éxito", MessageBoxButton.OK, MessageBoxImage.Information);
            TextBoxEducationLevelName.Text = string.Empty;
            EducationLevels.Add(educationLevel);
            AreButtonsEnabled = true;
        }
Example #8
0
        // GET
        public List <EducationLevel> Get()
        {
            List <EducationLevel> list = null;

            _prov.ExecuteCmd("dbo.EducationLevel_SelectAll",
                             inputParamMapper : null,
                             singleRecordMapper : delegate(IDataReader rdr, short set)
            {
                switch (set)
                {
                case 0:
                    EducationLevel el   = new EducationLevel();
                    int ord             = 0;
                    el.Id               = rdr.GetSafeInt32(ord++);
                    el.Code             = rdr.GetSafeString(ord++);
                    el.LevelOfEducation = rdr.GetSafeString(ord++);
                    el.DisplayOrder     = rdr.GetSafeInt32(ord++);
                    el.Inactive         = rdr.GetSafeBool(ord++);

                    if (list == null)
                    {
                        list = new List <EducationLevel>();
                    }
                    list.Add(el);
                    break;

                default:
                    //for additional result sets
                    break;
                }
            });
            return(list);
        }
Example #9
0
 public EducationInfo(string schoolName, string specialty, EducationLevel level, string levelName)
 {
     SchoolName = schoolName;
     Specialty  = specialty;
     Level      = level;
     LevelName  = levelName;
 }
Example #10
0
        public JsonResult DeleteEducationLevel(EducationLevel educationLevel)
        {
            var          isSuccess = true;
            var          message   = string.Empty;
            const string url       = "/EducationLevel/Index";

            permission = (RoleSubModuleItem)cacheProvider.Get(cacheKey) ?? roleSubModuleItemService.GetRoleSubModuleItemBySubModuleIdandRole(url,
                                                                                                                                             Helpers.UserSession.GetUserFromSession().RoleId);

            if (permission.DeleteOperation == true)
            {
                isSuccess = this.educationLevelService.DeleteEducationLevel(educationLevel.Id);
                if (isSuccess)
                {
                    message = Resources.ResourceEducationLevel.MsgEducationLevelDeleteSuccessful;
                }
                else
                {
                    message = Resources.ResourceEducationLevel.MsgEducationLevelDeleteFailed;
                }
            }
            else
            {
                message = Resources.ResourceCommon.MsgNoPermissionToDelete;
            }


            return(Json(new
            {
                isSuccess = isSuccess,
                message = message
            }, JsonRequestBehavior.AllowGet));
        }
        public EducationLevel Create(EducationLevel itemToCreate)
        {
            var role = _context.EducationLevels.Add(itemToCreate);

            _context.SaveChanges();
            return(role);
        }
Example #12
0
        public async Task <IActionResult> EditEduLvl(EducationLevel educationLevel)
        {
            db.EducationLevel.Update(educationLevel);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #13
0
 public Employee(string name, string surname, string patronymic, DateTime birthDate,
                 Gender gender, Nationality nationality, EducationLevel educationLevel, float salary)
     : base(name, surname, patronymic, birthDate, gender, nationality)
 {
     this.educationLevel = educationLevel;
     Salary = salary;
 }
Example #14
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] EducationLevel educationLevel)
        {
            if (id != educationLevel.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(educationLevel);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EducationLevelExists(educationLevel.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(educationLevel));
        }
Example #15
0
        public async Task <IActionResult> PutEducationLevel(int id, EducationLevel educationLevel)
        {
            if (id != educationLevel.Id)
            {
                return(BadRequest());
            }

            _context.Entry(educationLevel).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EducationLevelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #16
0
        public async Task <ActionResult <EducationLevel> > PostEducationLevel(EducationLevel educationLevel)
        {
            _context.EducationLevel.Add(educationLevel);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEducationLevel", new { id = educationLevel.Id }, educationLevel));
        }
        //SELECT ALL
        public List <EducationLevel> SelectAll()
        {
            List <EducationLevel> list = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.EducationLevel_SelectAll"
                                    , inputParamMapper : null

                                    , map : delegate(IDataReader reader, short set)
            {
                EducationLevel eLevel = new EducationLevel();

                int ord = 0;    //startingOrdinal

                eLevel.Id           = reader.GetSafeInt32(ord++);
                eLevel.Code         = reader.GetSafeString(ord++);
                eLevel.Name         = reader.GetSafeString(ord++);
                eLevel.Inactive     = reader.GetBoolean(ord++);
                eLevel.DisplayOrder = reader.GetInt32(ord++);
                eLevel.DateCreated  = reader.GetDateTime(ord++);
                eLevel.DateModified = reader.GetDateTime(ord++);

                if (list == null)
                {
                    list = new List <EducationLevel>();
                }

                list.Add(eLevel);
            }
                                    );
            return(list);
        }
        //GET BY ID
        public EducationLevel SelectById(int id)
        {
            EducationLevel eLevel = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.EducationLevel_SelectById", inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@Id", id);
            }

                                    , map : delegate(IDataReader reader, short set)
            {
                eLevel = new EducationLevel();

                int ord = 0;

                eLevel.Id           = reader.GetInt32(ord++);
                eLevel.Code         = reader.GetString(ord++);
                eLevel.Name         = reader.GetString(ord++);
                eLevel.Inactive     = reader.GetBoolean(ord++);
                eLevel.DisplayOrder = reader.GetInt32(ord++);
                eLevel.DateCreated  = reader.GetDateTime(ord++);
                eLevel.DateCreated  = reader.GetDateTime(ord++);
            }
                                    );
            return(eLevel);
        }
Example #19
0
 public Tutor(string name, string surname, string patronymic, DateTime birthDate,
              Gender gender, Nationality nationality, EducationLevel educationLevel, float salary,
              TutorSpeciality tutSpec)
     : base(name, surname, patronymic, birthDate, gender, nationality, educationLevel, salary)
 {
     tutorSpeciality = tutSpec;
 }
        public int UpdateEducationLevel(EducationLevelDTO data)
        {
            EducationLevel dataToUpdate = EducationLevelRequestFormatter.ConvertRespondentInfoFromDTO(data);
            var            res          = _unitOfWork.EducationLevelRepository.Update(dataToUpdate);

            _unitOfWork.Save();
            return(res);
        }
Example #21
0
 public Manager(string name, string surname, DateTime dateOfBirth,
                string identificationNumber, string email, string username, string phone,
                string password, EducationLevel educationLevel, Gender gender,
                string profession, City city, Address currResidence, InsurancePolicy insurancePolicy)
     : base(name, surname, dateOfBirth, identificationNumber, email, username, phone, password,
            educationLevel, gender, profession, city, currResidence, insurancePolicy)
 {
 }
Example #22
0
 public Person()
 {
     Sex = Sex.Female;
     Age = Age.ThirtyFiveToFortyFour;
     EducationLevel = EducationLevel.primary;
     HouseholdSize = HouseholdSize2.TwoPersons;
     Type = AgentType.Person;
 }
Example #23
0
 public Worker(string name, string surname, string patronymic, DateTime birthDate,
               Gender gender, Nationality nationality, EducationLevel educationLevel, float salary,
               string workDescription)
     : base(name, surname, patronymic, birthDate, gender, nationality, educationLevel, salary)
 {
     _isWorking = false;
     this.NextTask(workDescription);
 }
Example #24
0
        public ActionResult DeleteConfirmed(int id)
        {
            EducationLevel educationlevel = db.EducationLevels.Find(id);

            db.EducationLevels.Remove(educationlevel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #25
0
 public Person()
 {
     Sex = Sex.Female;
     Age = Age.ThirtyOneToForty;
     EducationLevel = EducationLevel.primary;
     Type = AgentType.Person;
     myID = idCounter++;
 }
Example #26
0
        public async Task Post(EducationLevel _educationLevel)
        {
            _educationLevel.CreateDate = GetDate;
            await aztuAkademik.EducationLevel.AddAsync(_educationLevel).ConfigureAwait(false);

            await aztuAkademik.SaveChangesAsync().ConfigureAwait(false);

            await Classes.TLog.Log("EducationLevel", "", _educationLevel.Id, 1, User_Id, IpAdress, AInformation).ConfigureAwait(false);
        }
Example #27
0
        public void Add(EducationLevelAddDto educationLevelDto)
        {
            var educationLevel = new EducationLevel()
            {
                Name = educationLevelDto.Name
            };

            _educationLevelRepository.Add(educationLevel);
        }
Example #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var message = Request.QueryString["m"];
                if (message != null)
                {
                    // Strip the query string from action
                    Form.Action = ResolveUrl("~/Customer/NewRequestForm");

                    SuccessMessage =
                        message == "AddRequestSuccess" ? "Your request has been added, you will receive an update within 48 hours."
                        //: message == "SetPwdSuccess" ? "Your password has been set."
                        //: message == "RemoveLoginSuccess" ? "The account was removed."
                        //: message == "AddPhoneNumberSuccess" ? "Phone number has been added"
                        //: message == "RemovePhoneNumberSuccess" ? "Phone number was removed"
                        //: message == "UpdateInfoSuccess" ? "Your information has been updated"
                        : String.Empty;
                    successMessage.Visible = !String.IsNullOrEmpty(SuccessMessage);
                }

                _skillList = _databaseConnection.GetSkillList();

                //Get the skills from the DB
                RequiredSkillListBox.DataSource     = _skillList;
                RequiredSkillListBox.DataValueField = "Id";
                RequiredSkillListBox.DataTextField  = "Name";
                RequiredSkillListBox.DataBind();

                RequestedSkillListBox.DataSource     = _skillList;
                RequestedSkillListBox.DataValueField = "Id";
                RequestedSkillListBox.DataTextField  = "Name";
                RequestedSkillListBox.DataBind();

                //Get State list
                StatesListBox.DataSource     = _databaseConnection.GetStates();
                StatesListBox.DataValueField = "Abbreviation";
                StatesListBox.DataTextField  = "Name";
                StatesListBox.DataBind();

                //Education Level
                var items = new List <string>
                {
                    "GED",
                    "High School Diploma",
                    "Grade School",
                    "Some College",
                    "Associates Degree",
                    "Bachelors Degree",
                    "Masters Degree",
                    "Doctorate"
                };

                EducationLevel.DataSource = items;
                EducationLevel.DataBind();
            }
        }
Example #29
0
 public Person(string currZone)
 {
     ZoneID = currZone;
     Sex = Sex.Female;
     Age = Age.ThirtyFiveToFortyFour;
     EducationLevel = EducationLevel.primary;
     HouseholdSize = HouseholdSize2.TwoPersons;
     Type = AgentType.Person;
 }
Example #30
0
        //
        // GET: /EducationLevel/Delete/5

        public ActionResult Delete(int id = 0)
        {
            EducationLevel educationlevel = db.EducationLevels.Find(id);

            if (educationlevel == null)
            {
                return(HttpNotFound());
            }
            return(View(educationlevel));
        }
 private void CreateCatEducationLevelTableData()
 {
     foreach (string cat in CatEducationLevel.GetCatagoryList())
     {
         EducationLevel catagory = new EducationLevel();
         catagory.EducationLevelCode = cat;
         catagory.Name = cat;
         SaveEducationLevel(catagory);
     }
 }
Example #32
0
 private Person(Person original)
 {
     Type = AgentType.Person;
     //copy the values
     ZoneID = original.ZoneID;
     Age = original.Age;
     Sex = original.Sex;
     HouseholdSize = original.HouseholdSize;
     EducationLevel = original.EducationLevel;
 }
        private void SaveEducationLevel(EducationLevel level)
        {
            EducationLevel educationLevel = db.EducationLevels.Find(level.EducationLevelCode);

            if (educationLevel == null)
            {
                db.EducationLevels.Add(level);
                db.SaveChanges();
            }
        }
        public async Task <ActionResult <EducationLevel> > Edit(string id, EducationLevel value)
        {
            // var product = new Product(value.Id);
            value.Id = ObjectId.Parse(id);
            _EducationLevel.Update(value, id);

            await _uow.Commit();

            return(RedirectToAction("Index"));
        }
Example #35
0
 public LoanRequestMainReport(int loanRequestId,
     string CURP,
     string names,
     string lastName,
     string secondLastName,
     string clltrlNames,
     string clltrlLastName,
     string clltrlSecondLastName,
     DateTime birthDate,
     Gender gender,
     Ocupation ocupation,
     EducationLevel educationLevel,
     Address address,
     ContactInformation contactInformation,
     string trackingCode,
     UInt64 internalTrackingCode,
     string userName,
     LoanRequestStatus loanRequestStatus,
     DateTime loanRequestDate,
     DateTime? loanAuthorizationDate,
     LoanType loanType,
     decimal loanedAmount,
     string sector,
     string subsector,
     string branch)
 {
     this._loanRequestId = loanRequestId;
     this._curp = CURP;
     this._names = names;
     this._lastName = lastName;
     this._secondLastName = secondLastName;
     this._collateralNames = clltrlNames;
     this._collateralLastName = clltrlLastName;
     this._collateralSecondLastName = clltrlSecondLastName;
     this._birthDate = birthDate;
     this._gender = gender;
     this._ocupation = ocupation;
     this._educationLevel = educationLevel;
     this._address = address;
     this._contactInformation = contactInformation;
     this._trackingCode = trackingCode;
     this._internalTrackingCode = internalTrackingCode;
     this._username = userName;
     this._loanRequestStatus = loanRequestStatus;
     this._loanRequestDate = loanRequestDate;
     this._loanAuthorizationDate = loanAuthorizationDate;
     this._loanType = loanType;
     this._loanedAmount = loanedAmount;
     this._sector = sector;
     this._subsector = subsector;
     this._branch = branch;
 }
Example #36
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++;
 }
Example #37
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++;
 }
 public LoanTrackingSolidarityGroupsReport(int groupId,
     string solidarityGroupName,
     Address solidarityGroupAddress,
     string CURP,
     string names,
     string lastName,
     string secondLastName,
     Gender gender,
     Ocupation ocupation,
     EducationLevel educationLevel,
     Address address,
     ContactInformation contactInformation,
     string trackingCode,
     UInt64 internalTrackingCode,
     LoanRequestStatus loanRequestStatus,
     DateTime loanRequestDate,
     DateTime? loanAuthorizationDate,
     LoanType loanType,
     decimal loanedAmount)
 {
     this._groupId = groupId;
     this._solidarityGroupName = solidarityGroupName;
     this._solidarityGroupAddress = solidarityGroupAddress;
     this._curp = CURP;
     this._names = names;
     this._lastName = lastName;
     this._secondLastName = secondLastName;
     this._gender = gender;
     this._ocupation = ocupation;
     this._educationLevel = educationLevel;
     this._address = address;
     this._contactInformation = contactInformation;
     this._trackingCode = trackingCode;
     this._internalTrackingCode = internalTrackingCode;
     this._loanRequestStatus = loanRequestStatus;
     this._loanRequestDate = loanRequestDate;
     this._loanAuthorizationDate = loanAuthorizationDate;
     this._loanType = loanType;
     this._loanedAmount = loanedAmount;
 }
Example #39
0
 public void SetEducationLevel(EducationLevel eduLvl)
 {
     EducationLevel = eduLvl;
 }
 public CostOfAttendance GetCostOfAttendance(EducationLevel educationLevel, HousingOption housingOption)
 {
     CostOfAttendanceKey key = new CostOfAttendanceKey(educationLevel, housingOption);
     return _constants.ContainsKey(key) ? _constants[key] : null;
 }
 public CostOfAttendanceKey(EducationLevel educationLevel, HousingOption housingOption)
 {
     EducationLevel = educationLevel;
     HousingOption = housingOption;
 }