Exemple #1
0
        protected void ButtonGridRefresh_OnClick(object sender, EventArgs e)
        {
            RadGridStudentList.Rebind();

            GetStudent();
            GetStudentContract();
        }
Exemple #2
0
        protected void StudentButtonClicked(object sender, RadToolBarEventArgs e)
        {
            if (e.Item.Text == "Update" && RadGridStudentList.SelectedValue != null)
            {
                if (IsValid)
                {
                    var cStud = new CStudent();
                    var stud  = cStud.Get(Convert.ToInt32(RadGridStudentList.SelectedValue));

                    stud.FirstName   = tbFirstName.Text;
                    stud.LastName1   = tbLastName1.Text;
                    stud.LastName2   = tbLastName2.Text;
                    stud.MiddleName1 = tbMiddleName1.Text;
                    stud.MiddleName2 = tbMiddleName2.Text;

                    stud.Address1InCanada   = tbCadAddress.Text;
                    stud.CityInCanada       = tbCadCity.Text;
                    stud.ProvinceInCanada   = tbCadProvince.Text;
                    stud.PostalCodeInCanada = tbCadZipcode.Text;

                    stud.PermanentAddress1   = tbPerAddress.Text;
                    stud.PermanentCity       = tbPerCity.Text;
                    stud.PermanentProvince   = tbPerState.Text;
                    stud.PermanentPostalCode = tbPerZiocode.Text;
                    stud.PermanentCountry    = (ddlPerCountry.SelectedValue == "") ? 239 : Convert.ToInt32(ddlPerCountry.SelectedValue); //239:N/A

                    stud.Phone1 = tbPhone1.Text;
                    stud.Phone2 = tbPhone2.Text;
                    stud.Email1 = tbEmail1.Text;
                    stud.Email2 = tbEmail2.Text;
                    stud.Fax    = tbFax.Text;

                    stud.DOB         = Convert.ToDateTime(tbDateOfBirth.SelectedDate);
                    stud.StudentType = Convert.ToInt32(ddlStudentType.SelectedValue);
                    stud.Passport    = tbPassport.Text;
                    stud.LoanNo      = tbLoanNo.Text;

                    stud.ContactName         = tbContactName.Text;
                    stud.ContactPhone        = tbContactPhone.Text;
                    stud.ContactRelationship = tbContactRelationship.Text;
                    stud.Comment             = tbComment.Text;

                    stud.Gender = Convert.ToBoolean(ddlGender.SelectedValue);
                    //stud.MarketerId = Convert.ToInt32(ddlmarketer.SelectedValue);

                    stud.VisaStatus       = Convert.ToInt32(ddlStatus.SelectedValue);
                    stud.VisaStart        = (tbStatusStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbStatusStartDate.SelectedDate);
                    stud.VisaEnd          = (tbStatusEndDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbStatusEndDate.SelectedDate);
                    stud.WorkPermitStatus = Convert.ToInt32(ddlPermit.SelectedValue);
                    stud.WorkPermitStart  = (tbPermitStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbPermitStartDate.SelectedDate);
                    stud.WorkPermitEnd    = (tbPermitEndDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbPermitEndDate.SelectedDate);

                    stud.Insurance       = Convert.ToBoolean(ddlInsurance.SelectedValue);
                    stud.InsuranceStart  = (tbInsuranceStartDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbInsuranceStartDate.SelectedDate);
                    stud.InsuranceEnd    = (tbInsuranceEndtDate.SelectedDate == null) ? Convert.ToDateTime("1900-01-01") : Convert.ToDateTime(tbInsuranceEndtDate.SelectedDate);
                    stud.InsuranceDayFee = (tbInsuranceDayFee.Text == null || tbInsuranceDayFee.Text == "") ? 0 : Convert.ToDecimal(tbInsuranceDayFee.Text);
                    stud.InsuranceTotal  = (tbInsuranceTotalAmt.Text == null || tbInsuranceTotalAmt.Text == "") ? 0 : Convert.ToDecimal(tbInsuranceTotalAmt.Text);

                    stud.CountryId = Convert.ToInt32(ddlCountry.SelectedValue);

                    stud.UpdatedId = CurrentUserId;

                    if (cStud.Update(stud))
                    {
                        // UP LOAD
                        FileDownloadList1.SaveFile(Convert.ToInt32(RadGridStudentList.SelectedValue));

                        ShowMessage("Update inqury successfully");
                    }
                    else
                    {
                        ShowMessage("Failed to update inqury");
                    }
                    RadGridStudentList.Rebind();
                }
            }
        }