Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,StudentId,Percentage")] Scholarships scholarships)
        {
            if (id != scholarships.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(scholarships);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ScholarshipsExists(scholarships.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(scholarships));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,StudentId,Percentage")] Scholarships scholarships)
        {
            if (ModelState.IsValid)
            {
                _context.Add(scholarships);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(scholarships));
        }
Ejemplo n.º 3
0
        internal Result Update()
        {
            Result       result      = new Result();
            Scholarships Scholarship = DALInstance;

            Scholarship.IsPassed      = this.IsPassed;
            Scholarship.IsCanceled    = this.IsCanceled;
            Scholarship.LastUpdatedBy = this.LoginIdentity.EmployeeCodeID;
            new ScholarshipsDAL().UpdateScholarshipStatus(Scholarship);
            result.Entity     = this;
            result.EnumMember = ScholarshipsValidationEnum.Done.ToString();
            return(result);
        }
Ejemplo n.º 4
0
        internal BaseScholarshipsBLL MapScholarship(Scholarships Scholarship)
        {
            try
            {
                BaseScholarshipsBLL BaseScholarshipBLL = null;
                if (Scholarship != null)
                {
                    if (Scholarship.ScholarshipTypeID == Convert.ToInt16(ScholarshipsTypesEnum.Internal))
                    {
                        BaseScholarshipBLL = GenericFactoryPattern <BaseScholarshipsBLL, InternalScholarshipsBLL> .CreateInstance();

                        ((InternalScholarshipsBLL)BaseScholarshipBLL).KSACity  = new KSACitiesBLL().MapKSACity(Scholarship.KSACities);
                        ((InternalScholarshipsBLL)BaseScholarshipBLL).Location = Scholarship.Location;
                    }
                    else if (Scholarship.ScholarshipTypeID == Convert.ToInt16(ScholarshipsTypesEnum.External))
                    {
                        BaseScholarshipBLL = GenericFactoryPattern <BaseScholarshipsBLL, ExternalScholarshipsBLL> .CreateInstance();

                        ((ExternalScholarshipsBLL)BaseScholarshipBLL).Country = new CountriesBLL().MapCountry(Scholarship.Countries);
                    }
                    else
                    {
                        BaseScholarshipBLL = new BaseScholarshipsBLL();
                    }


                    BaseScholarshipBLL.ScholarshipType      = new ScholarshipsTypesBLL().MapScholarshipType(Scholarship.ScholarshipsTypes);
                    BaseScholarshipBLL.ScholarshipID        = Scholarship.ScholarshipID;
                    BaseScholarshipBLL.ScholarshipStartDate = Scholarship.ScholarshipStartDate.Date;
                    BaseScholarshipBLL.ScholarshipEndDate   = Scholarship.ScholarshipEndDate.Date;
                    BaseScholarshipBLL.CreatedDate          = Scholarship.CreatedDate;
                    BaseScholarshipBLL.IsCanceled           = Scholarship.IsCanceled;
                    //BaseScholarshipBLL.Employee = new EmployeesCodesBLL().MapEmployeeCode(Scholarship.EmployeesCodes);

                    BaseScholarshipBLL.CreatedBy = Scholarship.CreatedByNav != null ? new EmployeesCodesBLL().MapEmployeeCode(Scholarship.CreatedByNav) : null;

                    BaseScholarshipBLL.Employee            = Scholarship.EmployeesCodes != null ? new EmployeesCodesBLL().MapEmployeeCode(Scholarship.EmployeesCodes) : null;//new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(Vacation.EmployeesCareersHistory) : null;
                    BaseScholarshipBLL.Qualification       = new QualificationsBLL().MapQualification(Scholarship.Qualifications);
                    BaseScholarshipBLL.ScholarshipTypeEnum = (ScholarshipsTypesEnum)Scholarship.ScholarshipTypeID;
                    BaseScholarshipBLL.ScholarshipReason   = Scholarship.ScholarshipReason;
                    BaseScholarshipBLL.ScholarshipJoinDate = Scholarship.ScholarshipJoinDate;
                    BaseScholarshipBLL.IsPassed            = Scholarship.IsPassed;
                }
                return(BaseScholarshipBLL);
            }
            catch
            {
                throw;
            }
        }
Ejemplo n.º 5
0
        private Result ExtendScholarship()
        {
            Result       result       = null;
            Scholarships Scholarships = DALInstance;

            Scholarships.ScholarshipStartDate = this.GetByScholarshipID(this.ScholarshipID).ScholarshipStartDate;
            new ScholarshipsDAL().UpdateScholarshipStatus(Scholarships);
            int ScholarshipDetailID = new ScholarshipsDetailsDAL().Insert(this.GetScholarshipDetailInstance(ScholarshipsActionsEnum.Extend));

            if (ScholarshipDetailID != 0)
            {
                result            = new Result();
                result.Entity     = this;
                result.EnumType   = typeof(DelegationsValidationEnum);
                result.EnumMember = ScholarshipsValidationEnum.Done.ToString();
            }
            return(result);
        }
Ejemplo n.º 6
0
        private Result CancelScholarship()
        {
            Result       result      = null;
            Scholarships Scholarship = this.DALInstance;

            Scholarship.IsCanceled = true;
            new ScholarshipsDAL().UpdateScholarshipStatus(Scholarship);
            int ScholarshipDetailID = new ScholarshipsDetailsDAL().Insert(this.GetScholarshipDetailInstance(ScholarshipsActionsEnum.Cancel));

            if (ScholarshipDetailID != 0)
            {
                result            = new Result();
                result.Entity     = this;
                result.EnumType   = typeof(DelegationsValidationEnum);
                result.EnumMember = ScholarshipsValidationEnum.Done.ToString();
            }
            return(result);
        }
Ejemplo n.º 7
0
        private Result EditScholarship()
        {
            Result result = null;

            Scholarships Scholarship = DALInstance;

            new ScholarshipsDAL().Update(Scholarship);
            // update dates of creation record
            new ScholarshipsDetailsDAL().UpdateCreationDates(new ScholarshipsDetails()
            {
                FromDate        = this.ScholarshipStartDate,
                ToDate          = ScholarshipEndDate,
                ScholarshipID   = this.ScholarshipID,
                LastUpdatedDate = DateTime.Now,
                LastUpdatedBy   = this.LoginIdentity.EmployeeCodeID
            });
            result            = new Result();
            result.Entity     = this;
            result.EnumMember = ScholarshipsValidationEnum.Done.ToString();
            return(result);
        }
Ejemplo n.º 8
0
        private Result AddScholarship()
        {
            Result result = null;

            List <ScholarshipsDetails> ScholarshipDetail = new List <ScholarshipsDetails>();

            ScholarshipDetail.Add(this.GetScholarshipDetailInstance(ScholarshipsActionsEnum.Add));
            Scholarships Scholarship = this.DALInstance;

            Scholarship.ScholarshipsDetails = ScholarshipDetail;
            this.ScholarshipID = new ScholarshipsDAL().Insert(Scholarship);

            if (this.ScholarshipID != 0)
            {
                result            = new Result();
                result.Entity     = this;
                result.EnumType   = typeof(ScholarshipsValidationEnum);
                result.EnumMember = ScholarshipsValidationEnum.Done.ToString();
            }
            return(result);
        }
Ejemplo n.º 9
0
        private void buttonScholarships_Click(object sender, EventArgs e)
        {
            Scholarships plForm = new Scholarships();

            plForm.Show();
        }