Пример #1
0
        private void save_Click(object sender, RoutedEventArgs e)
        {
            if (lstData.SelectedItems.Count <= 0)
            {
                MyMessageBox.Show("لم يتم اختيار أي قيمة للتعديل");
                return;
            }
            if (txtUpdatedValue.Text.Trim() == "")
            {
                MyMessageBox.Show("يجب ادخال القيمة الجديدة");
                return;
            }
            if (MyMessageBox.Show("هل تريد تأكيد تعديل البيانات", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                string query = "Update " + (column == "Job" || column == "HealthStatus" ? "Parent" : "House") + " set " + column + " = '" + txtUpdatedValue.Text.Replace("\'", "").Trim() + "' where " + column + " in (";
                foreach (string item in lstData.SelectedItems)
                {
                    query += "'" + item.Replace("\'", "") + "',";
                }
                query = query.Remove(query.Length - 1) + ")";

                MyMessageBox.Show("تم تعديل " + BaseDataBase._NonQuery(query) + " قيمة في قاعدة البيانات");


                lstData.ItemsSource = column == "" ? null : BaseDataBase.GetAllStrings("Select Distinct " + column + " from " + (column == "Job" || column == "HealthStatus" ? "Parent" : "House") + " order by " + column);
            }
        }
Пример #2
0
 private void Rad1_Checked(object sender, RoutedEventArgs e)
 {
     if (radBasePlace.IsChecked == true)
     {
         column = "OldAddress";
     }
     else if (radAddress.IsChecked == true)
     {
         column = "HouseSection";
     }
     else if (radStreet.IsChecked == true)
     {
         column = "HouseStreet";
     }
     else if (radPoint.IsChecked == true)
     {
         column = "Address";
     }
     else if (radJob.IsChecked == true)
     {
         column = "Job";
     }
     else if (radHealth.IsChecked == true)
     {
         column = "HealthStatus";
     }
     else
     {
         column = "";
     }
     lstData.ItemsSource = column == "" ? null : BaseDataBase.GetAllStrings("Select Distinct " + column + " from " + (column == "Job" || column == "HealthStatus" ? "Parent" : "House") + " order by " + column);
 }
Пример #3
0
 public OrphanHealthControl()
 {
     InitializeComponent();
     cmbo.ItemsSource = BaseDataBase.GetAllStrings("select Distinct HealthSituation from OrphanHealth");
 }
 public QualificationContainerWindow(Qualification.QualificationPersonType PersonType)
 {
     InitializeComponent();
     this.PersonType  = PersonType;
     cmbo.ItemsSource = BaseDataBase.GetAllStrings("select Distinct QualificationName from PersonQualification");
 }
Пример #5
0
 void UpdateCombo()
 {
     cmbo.ItemsSource = BaseDataBase.GetAllStrings("select Distinct NeedType from FamilyNeed order by NeedType");
 }
Пример #6
0
 public InventoryItemSta()
 {
     InitializeComponent();
     cmboItem.ItemsSource = BaseDataBase.GetAllStrings("select Name from Item order by Name");
 }
Пример #7
0
 void UpdateCombo()
 {
     cmbo.ItemsSource = BaseDataBase.GetAllStrings("select Distinct SupportType from ExternalFamilySupport order by SupportType");
 }
 void UpdateCombo()
 {
     cmbo.ItemsSource = BaseDataBase.GetAllStrings("select Distinct PropertyType from FamilyProperty order by PropertyType");
 }