private void SaveRecord() { USTTIDataAccess data = new USTTIDataAccess(); USTTI.Base.Student objStudentTbl = new USTTI.Base.Student(); //UsttiDataObject.student objStudentTbl = new UsttiDataObject.student(); UsttiDataObject.PhoneNumber objBusPhoneNumber = new UsttiDataObject.PhoneNumber(); UsttiDataObject.PhoneNumber objHomePhoneNumber = new UsttiDataObject.PhoneNumber(); UsttiDataObject.PhoneNumber objFaxPhoneNumber = new UsttiDataObject.PhoneNumber(); StudentID = data.GetNextStudentID(); objStudentTbl.StudentID = StudentID; objStudentTbl.Honorific = DropDownListHonorific.SelectedItem.Text; objStudentTbl.FirstName = UtilManager.RemoveSpecialCharacters(txtFirstName.Text.ToString()); objStudentTbl.MiddleName = UtilManager.RemoveSpecialCharacters(txtMiddleName.Text.ToString()); objStudentTbl.LastName = UtilManager.RemoveSpecialCharacters(txtLastName.Text.ToString()); objStudentTbl.Suffix = UtilManager.RemoveSpecialCharacters(txtSuffix.Text.ToString()); objStudentTbl.DOB = Convert.ToDateTime(dob_selector.GetDate().ToString()); objStudentTbl.Sex = DropDownListSex.SelectedItem.Text; objStudentTbl.Org1 = UtilManager.RemoveSpecialCharacters(txtOrg1.Text.ToString()); objStudentTbl.Title = txtTitle.Text; objStudentTbl.Addr1 = UtilManager.RemoveSpecialCharacters(txtAddress1.Text.ToString()); objStudentTbl.City = UtilManager.RemoveSpecialCharacters(txtCity.Text.ToString()); objStudentTbl.ZipCode = txtZipCode.Text; objStudentTbl.BusPhone = objBusPhoneNumber.getNumber(txtBusCountryCode, txtBusAreaCode, txtBusPhoneNumber); objStudentTbl.HomePhone = objHomePhoneNumber.getNumber(txtHomeCountryCode, txtHomeAreaCode, txtHomePhoneNumber); objStudentTbl.Fax = objFaxPhoneNumber.getNumber(txtFaxCountryCode, txtFaxAreaCode, txtFaxPhoneNumber); objStudentTbl.CellPhone = txtCellPhone.Text; objStudentTbl.BusEmail = UtilManager.RemoveSpecialCharacters(txtBusEmail.Text.ToString()); objStudentTbl.PerEmail = UtilManager.RemoveSpecialCharacters(txtPerEmail.Text.ToString()); objStudentTbl.SpvrName = UtilManager.RemoveSpecialCharacters(txtSpvrName.Text.ToString()); objStudentTbl.SpvrTitle = UtilManager.RemoveSpecialCharacters(txtSpvrTitle.Text.ToString()); objStudentTbl.SpvrEmail = UtilManager.RemoveSpecialCharacters(txtSupvrEmail.Text.ToString()); objStudentTbl.Memo = UtilManager.RemoveSpecialCharacters(txtMemo.Text.ToString()); objStudentTbl.PNG = PNGRadioButton.SelectedValue; objStudentTbl.HomeAddr1 = UtilManager.RemoveSpecialCharacters(txtHomeAddress1.Text.ToString()); objStudentTbl.HomeCity = UtilManager.RemoveSpecialCharacters(txtHomeCity.Text.ToString()); objStudentTbl.HomeZipCode = txtHomeZipCode.Text; objStudentTbl.CountryID = Convert.ToInt32(CountryDropDownList.SelectedValue); objStudentTbl.PassNum = txtPassportNum.Text; objStudentTbl.PassExpDate = Convert.ToDateTime(pass_exp_date_selector.GetDate()); objStudentTbl.PassCountry = Convert.ToInt32(PassCountryDataList.SelectedValue); objStudentTbl.LastUpdateTime = DateTime.Now; objStudentTbl.ReadingSkill = ReadingSkill.SelectedValue; objStudentTbl.WritingSkill = WritingSkill.SelectedValue; objStudentTbl.SpeakingSkill = SpeakingSkill.SelectedValue; objStudentTbl.ComprehensionSkill = Comprehension.SelectedValue; data.InsertStudentRecord(objStudentTbl); }
protected void SaveUserInputinEdit(Decimal strStudentID) { USTTIDataAccess data = new USTTIDataAccess(); USTTI.Base.Student objStudentTbl = new USTTI.Base.Student(); objStudentTbl.StudentID = strStudentID; objStudentTbl.Honorific = DropDownListHonorific.SelectedItem.Text; objStudentTbl.FirstName = txtFirstName.Text; objStudentTbl.MiddleName = txtMiddleName.Text; objStudentTbl.LastName = txtLastName.Text; objStudentTbl.Suffix = txtSuffix.Text; objStudentTbl.DOB = Convert.ToDateTime(dob_selector.GetDate()); objStudentTbl.Sex = DropDownListSex.SelectedItem.Text; objStudentTbl.Org1 = txtOrg1.Text; objStudentTbl.Title = txtTitle.Text; objStudentTbl.Addr1 = txtAddress1.Text; objStudentTbl.City = txtCity.Text; objStudentTbl.ZipCode = txtZipCode.Text; if (ViewState["oldbusphnbrformat"].Equals(true)) { objStudentTbl.BusPhone = txtBusPhoneNumberOld.Text.Trim(); } else { objStudentTbl.BusPhone = Regex.Replace(objBusPhoneNumber.getNumber(txtBusCountryCode, txtBusAreaCode, txtBusPhoneNumber), "\\s+", ""); } if (ViewState["oldhomephnbrformat"].Equals(true)) { objStudentTbl.HomePhone = txthomephonenumberoldformat.Text.Trim(); } else { objStudentTbl.HomePhone = Regex.Replace(objHomePhoneNumber.getNumber(txtHomeCountryCode, txtHomeAreaCode, txtHomePhoneNumber), "\\s+", ""); } if (ViewState["oldfaxphnbrformat"].Equals(true)) { objStudentTbl.Fax = txtfaxnumberoldformat.Text.Trim(); } else { objStudentTbl.Fax = Regex.Replace(objFaxPhoneNumber.getNumber(txtFaxCountryCode, txtFaxAreaCode, txtFaxPhoneNumber), "\\s+", ""); } objStudentTbl.CellPhone = txtCellPhone.Text; objStudentTbl.BusEmail = txtBusEmail.Text; objStudentTbl.PerEmail = txtPerEmail.Text; objStudentTbl.SpvrName = txtSpvrName.Text; objStudentTbl.SpvrTitle = txtSpvrTitle.Text; objStudentTbl.SpvrEmail = txtSupvrEmail.Text; objStudentTbl.PNG = PNGRadioButton.SelectedValue; objStudentTbl.Memo = txtMemo.Text; objStudentTbl.HomeAddr1 = txtHomeAddress1.Text; objStudentTbl.HomeCity = txtHomeCity.Text; objStudentTbl.HomeZipCode = txtHomeZipCode.Text; objStudentTbl.CountryID = Convert.ToInt32(CountryDropDownList.SelectedValue); objStudentTbl.PassNum = txtPassportNum.Text; objStudentTbl.PassExpDate = Convert.ToDateTime(pass_exp_date_selector.GetDate()); objStudentTbl.PassCountry = Convert.ToInt32(PassCountryDataList.SelectedValue); objStudentTbl.ReadingSkill = ReadingSkill.SelectedValue.Trim(); objStudentTbl.WritingSkill = WritingSkill.SelectedValue.Trim(); objStudentTbl.SpeakingSkill = SpeakingSkill.SelectedValue.Trim(); objStudentTbl.ComprehensionSkill = Comprehension.SelectedValue.Trim(); data.UpdateStudentRecord(objStudentTbl); }