private void AddMeasureBtn_OnClick(object sender, RoutedEventArgs routedEventArgs)
 {
     var measureManager = new MeasureManager();
     string name = MeasureNameTxt.Text;
     if (string.IsNullOrWhiteSpace(name) || string.IsNullOrEmpty(name)) return;
     measureManager.AddMeasure(name);
     LoadMeasureGridControl();
 }
 private void LoadMeasureGridControl()
 {
     var measureManager = new MeasureManager();
     DataTable measureTable = measureManager.GetMeasureDataTable();
     MeasureGridControl.ItemsSource = measureTable.DefaultView;
     _measureId = -1;
     _measureName = null;
     MeasureNameTxt.Clear();
 }
 public AddProductView(string animationName)
 {
     InitializeComponent();
     _CategorysClient = new CategorysClient();
     _productManger = new ProductManger();
      _measureManager = new MeasureManager();
     if (string.IsNullOrEmpty(animationName)) return;
     var animation = (Storyboard) Application.Current.Resources[animationName];
     LayoutRoot.BeginStoryboard(animation);
 }
 private void DeleteMeasureBtn_OnClick(object sender, RoutedEventArgs routedEventArgs)
 {
     try
     {
         if (_measureId < 0) return;
         var measureManager = new MeasureManager();
         measureManager.RemoveMeasure(_measureId);
         LoadMeasureGridControl();
     }
     catch (Exception)
     {
         //
     }
 }
 private void UpdateMeasureBtn_OnClick(object sender, RoutedEventArgs routedEventArgs)
 {
     try
     {
         string name = MeasureNameTxt.Text;
         if (_measureId >= 0 && !string.IsNullOrWhiteSpace(name) && !string.IsNullOrEmpty(name))
         {
             var measureManager = new MeasureManager();
             measureManager.UpdateMeasure(_measureId, name);
             LoadMeasureGridControl();
         }
     }
     catch (Exception)
     {
         //
     }
 }
 private void MeasureCbx_OnGotFocus(object sender, RoutedEventArgs e)
 {
     Dispatcher.BeginInvoke(new Action(() =>
     {
     var measureManager = new MeasureManager();
     var listUnits = measureManager.GetMeasureList();
     MeasureCbx.ItemsSource = listUnits;
     }));
 }