private void SaveBtn_Click(object sender, RoutedEventArgs e)
 {
     if (CoName.Text == "")
     {
         l1.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l1.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (NationalId.Text == "")
     {
         l2.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l2.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (RegNumTxt.Text == "")
     {
         l3.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l3.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (CompanyType.SelectedIndex == -1)
     {
         l4.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l4.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (AddressTxt.Text == "")
     {
         l5.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l5.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (EmailTxt.Text == "")
     {
         l6.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l6.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (FaxTxt.Text == "")
     {
         l7.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l7.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (CoPhoneTxt.Text == "")
     {
         l8.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l8.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (FNameTxt.Text == "")
     {
         l9.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l9.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (LNamrTxt.Text == "")
     {
         l10.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l10.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (ContTick.IsChecked == false && ConsTick.IsChecked == false)
     {
         l11.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l11.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (TypeTick1.IsChecked == false && TypeTick2.IsChecked == false && TypeTick3.IsChecked == false && TypeTick4.IsChecked == false)
     {
         l12.Foreground = new SolidColorBrush(Colors.Red);
     }
     else
     {
         l12.Foreground = new SolidColorBrush(Colors.Black);
     }
     if (AddressTxt.Text == "" || NationalId.Text == "" || FaxTxt.Text == "" || EmailTxt.Text == "" || CoName.Text == "" || CompanyType.SelectedIndex == -1 || CoPhoneTxt.Text == "" || FNameTxt.Text == "" || LNamrTxt.Text == "" || RegNumTxt.Text == "" || (ContTick.IsChecked == false && ConsTick.IsChecked == false) || TypeTick1.IsChecked == false && TypeTick2.IsChecked == false && TypeTick3.IsChecked == false)
     {
         ErrorHandler.NotifyUser("برخی اطلاعات ضروری وارد نشده اند");
         return;
     }
     CurrentCont.ContractorId = DataManagement.CreateContractor(CoName.Text, CommercialName.Text, CompanyType.Text, StateTxt.Text, CityTxt.Text,
                                                                AddressTxt.Text, PostCodetxt.Text, null, CoPhoneTxt.Text, FaxTxt.Text, FNameTxt.Text, LNamrTxt.Text,
                                                                "social number", EmailTxt.Text, PhoneTxt.Text, CellTxt.Text, (bool)ContTick.IsChecked, (bool)ConsTick.IsChecked, (bool)TypeTick1.IsChecked,
                                                                (bool)TypeTick2.IsChecked, (bool)TypeTick3.IsChecked, Reshte1.Text, Reshte2.Text, Int32.Parse(Base1.Text), Int32.Parse(Base2.Text),
                                                                false, false, null, false, null, false, null,
                                                                false, null, false, null, null, RegNumTxt.Text, NationalId.Text, (bool)TypeTick1.IsChecked, (bool)TypeTick2.IsChecked, (bool)TypeTick3.IsChecked, false);
     if (CurrentCont.ContractorId != -1)
     {
         SaveBtn.IsEnabled = false;
         MessageBox.Show("ثبت شد");
     }
     else
     {
         MessageBox.Show("عملیات موفقیت آمیز نبود");
     }
 }