private void IUD() { ImageConvertor objImageConvertor = new ImageConvertor(); GetGender(); string sql = "exec [SMS].[IUDStudentDetails]"; List <string> lst = new List <string>(); this.Picture = string.Empty; lst.Add(IUDFlag); lst.Add(StudentID); lst.Add(EnrollmentNo); lst.Add(FirstName); lst.Add(MiddleName); lst.Add(LastName); lst.Add(Surname); lst.Add(DateOfBirth.ToString("yyyyMMdd")); lst.Add(DateOfAdmission.ToString("yyyyMMdd")); lst.Add(Gender); lst.Add(Address); lst.Add(MobileNumber); lst.Add(EmergencyContactNo1); lst.Add(EmergencyContactNo2); lst.Add(MotherName); lst.Add(SelectedOccupationMother.StaticID.ToString()); lst.Add(FatherName); lst.Add(SelectedOccupationFather.StaticID.ToString()); lst.Add(EmailAddress); lst.Add(Nationality); lst.Add(Caste); lst.Add(SelectedReligion.StaticID.ToString()); lst.Add(LeavingDate.ToString("yyyyMMdd")); lst.Add(PreviousSchool); lst.Add(Picture); lst.Add(Age); lst.Add(PhotoID); lst.Add(Schoolid); DataTable dtResult = DAL.Select(sql, lst); if (dtResult != null && dtResult.Rows.Count > 0) { this.StudentID = dtResult.Rows[0][0].ToString(); IUDStudentClassMapping(); IUDDocumentMapping(); MessageBox.Show("Data Saved Successfully"); ClearFormField(); GetStudentAsyn(); } }
private void SerchButton_Click(object sender, RoutedEventArgs e) { if (DateTime.Compare(ArrivalDate.SelectedDate.Value, LeavingDate.SelectedDate.Value) < 0) { Area_ComboBox.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource(); Type_ComboBox.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource(); Adult_Textbox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); Children_Textbox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); ArrivalDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); LeavingDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); guestRequest.Pool = ThreeStateToChoice(SwimmingPool_CheckBox); guestRequest.Jacuzzi = ThreeStateToChoice(Jacuzzi_CheckBox); guestRequest.Garden = ThreeStateToChoice(Garden_CheckBox); guestRequest.ChildrensAttractions = ThreeStateToChoice(ChildrensAttractions_CheckBox); List <HostingUnit> HostingUnitList = bl.MachUnitToRequest(guestRequest); if (HostingUnitList.Count() == 0) { MessageBox.Show("Sorry, their is no hosting unit maching to your request!!"); GuestRequest_UserControl guestRequest_UserControl = new GuestRequest_UserControl(); (this.Parent as StackPanel).Children.Add(guestRequest_UserControl); (this.Parent as StackPanel).Children.Remove(this); } else { foreach (var hu in HostingUnitList) { HostingUnit_UserControl hostingUnit_UserControl = new HostingUnit_UserControl(hu, guestRequest); (this.Parent as StackPanel).Children.Add(hostingUnit_UserControl); } (this.Parent as StackPanel).Children.Remove(this); } } else { MessageBox.Show("Leaving day cannot be before arrival day!"); } }