Пример #1
0
 private void Save()
 {
     ScholarshipServiceClient scholarshipService = new ScholarshipServiceClient();
     Boolean     ret         = false;
     string      message     = String.Empty;
     Scholarship scholarship = new Scholarship()
     {
         ScholarshipCode = txtScholarshipCode.Text.ToString(),
         Privilege       = txtPrivilege.Text.ToString(),
         Condition       = txtCondition.Text.ToString(),
         Description     = txtDescription.Text.ToString()
                           //StopRightHere
     };
 }
 private void Save()
 {
     ScholarshipServiceClient scholarshipService = new ScholarshipServiceClient();
     Boolean ret = false;
     string message = String.Empty;
     Scholarship scholarship = new Scholarship()
     {
         ScholarshipCode = txtScholarshipCode.Text.ToString(),
         Privilege = txtPrivilege.Text.ToString(),
         Condition = txtCondition.Text.ToString(),
         Description = txtDescription.Text.ToString()
         //StopRightHere
     };
 }
Пример #3
0
        private void frmScholarshipDiscount_Load(object sender, EventArgs e)
        {
            if (Op.Equals("newScholarshipDiscount"))
            {
                txtCode.Text = scholarshipCode.ToString();
                txtCode.Enabled = false;

                ScholarshipServiceClient fSC = new ScholarshipServiceClient();
               // fee = new List<Fee>(fSC.GetAllFees());

            //    cmbFee.DataSource = fee;
                cmbFee.ValueMember = "FeeID";
                cmbFee.DisplayMember = "FeeDescription";
            }
        }
Пример #4
0
        public void LoadScholarships()
        {
            ScholarshipServiceClient scholarshipService = new ScholarshipServiceClient();
            string message = String.Empty;
            try
            {
                var scholarships = scholarshipService.GetAllScholarships();
                scholarshipList = new List<ScholarshipDiscount>(scholarships);
                gvScholarship.DataSource = scholarships;
                gvScholarship.Refresh();

                if (gvScholarship.RowCount != 0)
                    gvScholarship.Rows[0].IsSelected = true;
            }
            catch (Exception ex)
            {
                message = "Error Loading Scholarship List";
                MessageBox.Show(ex.ToString());
            }
        }
Пример #5
0
        public void LoadScholarships()
        {
            ScholarshipServiceClient scholarshipService = new ScholarshipServiceClient();
            string message = String.Empty;

            try
            {
                var scholarships = scholarshipService.GetAllScholarships();
                scholarshipList          = new List <Scholarship>(scholarships);
                gvScholarship.DataSource = scholarships;
                gvScholarship.Refresh();

                if (gvScholarship.RowCount != 0)
                {
                    gvScholarship.Rows[0].IsSelected = true;
                }
            }
            catch (Exception ex)
            {
                message = "Error Loading Scholarship List";
                MessageBox.Show(ex.ToString());
            }
        }
Пример #6
0
        private void Save()
        {
            ScholarshipServiceClient sService = new ScholarshipServiceClient();
            Boolean ret = false;
            string message = String.Empty;
            ScholarshipDiscount scholarship = new ScholarshipDiscount();
            //    {
            //        ScholarshipCode = txtScholarshipCode.Text.ToString(),
            //        Privilege = txtPrivilege.Text.ToString(),
            //        Condition = txtCondition.Text.ToString(),
            //        Description = txtDescription.Text.ToString(),
            //        scholarshipDiscounts = scholarshipDiscountList.ToArray(),
            //    };
            if (Op.Equals("edit"))
                ret = sService.UpdateScholarship(ref scholarship, ref message);
            else
                ret = sService.CreateScholarship(ref scholarship, ref message);

            if (ret)
                MessageBox.Show("Saved Successfully");
            else
                MessageBox.Show("Error Saving");

            if (Op.Equals("edit"))
                Close();
            if (Op.Equals("new"))
            {
                Op = "edit";
                txtScholarshipCode.Enabled = false;
                gvScholarshipDetails.Enabled = true;
            }
            this.Close();
        }
Пример #7
0
        private void fmScholarship_Load(object sender, EventArgs e)
        {
            ScholarshipServiceClient sService = new ScholarshipServiceClient();
            //    fee = new List<Fee>(sService.GetAllFees());

            colFee = new GridViewComboBoxColumn("Fee");
            colFee.HeaderText = "Fee";
            colFee.FieldName = "FeeID";
            colFee.ValueMember = "FeeID";
            colFee.DisplayMember = "FeeDescription";
            colFee.Width = 180;

              //  colFee.DataSource = fee;

            gvScholarshipDetails.Columns.Add(colFee);

            if (Op.Equals("edit"))
            {
                SetField();
                SetScholarshipDiscountGrid();
            }

            if (Op.Equals("new"))
            {
                BindScholarshipDiscountGrid();
                gvScholarshipDetails.Enabled = false;
            }
        }
Пример #8
0
        private void AssessStudent_Load(object sender, EventArgs e)
        {
            RegistrationServiceClient registrationService = new RegistrationServiceClient();
            List<Fee> fees = new List<Fee>();
            ScholarshipServiceClient scholarshipService = new ScholarshipServiceClient();
            List<RegistrationServiceRef.ScholarshipDiscount> scholarships = new List<RegistrationServiceRef.ScholarshipDiscount>();

            currentSY = registrationService.GetCurrentSY();

            StudentAssessed = registrationService.GetStudentEnrolled(StudentId, currentSY.SY);
            txtGradeLevel.Text = StudentAssessed.GradeLevel;
            txtIDnum.Text = StudentAssessed.StudentId;
            txtName.Text = StudentAssessed.StudentName;
            txtSY.Text = currentSY.SY;

            //scholarshipDiscount = scholarshipService.GetAllScholarshipDiscount(StudentAssessed.DiscountId);
            //scholarshipDiscount = scholarshipService.GetAllScholarships();

            fees = new List<Fee>(registrationService.GetStudentFees(StudentAssessed));
            gvAssessment.DataSource = fees;
            fees.ToArray();

            scholarships = new List<RegistrationServiceRef.ScholarshipDiscount>(registrationService.GetScholarshipDiscounts());

            int scholarshipDiscountId = StudentAssessed.DiscountId;

            RegistrationServiceRef.ScholarshipDiscount sd = new RegistrationServiceRef.ScholarshipDiscount();

            sd = scholarships.Find(v => v.ScholarshipDiscountId == scholarshipDiscountId);

            amountTuition = (double)fees[0].Amount;
            enrollment = (double)fees[1].Amount;

            // Read Only TextBox
            tuitionFee.ReadOnly = true;
            discountPercent.ReadOnly = true;
            totalTuitionFee.ReadOnly = true;
            enrollmentFee.ReadOnly = true;
            enrTotalTuitionFee.ReadOnly = true;
            subTotal.ReadOnly = true;
            discountbyAmountSubTotal.ReadOnly = true;
            Total.ReadOnly = true;

            // Total Tuition Fee
            tuitionFee.Text = amountTuition.ToString("0.###");

            // Percent Discount
            double perc = 0;
            double percRound = 0;
            double percInitial = 0;

            perc = (double)sd.Discount;
            if (sd.Discount == null)
            {
                discountPercent.Enabled = false;
            }
            else
            {
                discountPercent.Text = perc.ToString("0.##");
                percRound = perc / 100;
                if (percRound == 1)
                {
                    percValue = amountTuition;
                    fullPaymentDisc.ReadOnly = true;
                } else {
                    percInitial = amountTuition * percRound;
                    percValue = amountTuition - percInitial;
                }
            }

               /* Operations */
            // Operation for Percent Discount if not null

            if (fullPaymentDisc != null)
            {
                finalPercentDisc = amountTuition - percValue - fullPaymentDiscount;
            }
            else
            {
                finalPercentDisc = amountTuition - percValue;
            }

            // Total Tuition Fee
            totalTuitionFee.Text = finalPercentDisc.ToString("0.##");

            // Enrollment Fee
            enrollmentFee.Text = enrollment.ToString();

            // Total Tuition Fee
            enrTotalTuitionFee.Text = finalPercentDisc.ToString("0.##");

            // Sub Total

            subTotalValue = enrollment + finalPercentDisc;
            subTotal.Text = subTotalValue.ToString("0.##");

            // Sub Total
            discountbyAmountSubTotal.Text = subTotalValue.ToString("0.##");

            // Discount by Amount
            double discByAmout = 0;
            //discByAmout = discountByAmount

            // Para ma assess og ma save sa db
            //var assessments = registrationService.AssessMe(StudentAssessed);

            //gvAssessment.DataSource = assessments;
        }