Example #1
0
        public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container)
        {
            Calibration2 currentItem = item as Calibration2;

            if (currentItem.IsEnabled)
            {
                return(EnabledStyle);
            }

            return(NormalStyle);
        }
Example #2
0
        public List <Calibration2> GetCalibrations(int id)
        {
            var calibrationQuery = Entities.Calibrations.Where(x => x.IdId == id);

            List <Calibration2> result = new List <Calibration2>();

            foreach (var calibration in calibrationQuery)
            {
                Calibration2 calibrationX = new Calibration2();
                calibrationX.CalibrationId        = calibration.CalibrationId;
                calibrationX.IdId                 = calibration.IdId;
                calibrationX.CalibrationOperation = (CalibrationOperation)calibration.CalibrationOperation;
                calibrationX.CalibrationValue     = calibration.CalibrationValue;
                calibrationX.IsEnabled            = calibration.IsEnabled;
                calibrationX.Title                = calibration.Id.Title;
                calibrationX.Date                 = (DateTime)calibration.Date;
                calibrationX.PersianDateString    = calibration.Date.ToPersianString();

                if (calibration.IsEnabled)
                {
                    calibrationX.IsEnabledString = "فعال";
                }
                else
                {
                    calibrationX.IsEnabledString = "غیر فعال";
                }

                if (calibration.CalibrationOperation == (decimal)CalibrationOperation.Jam)
                {
                    calibrationX.CalibrationOperationString = "جمع";
                }
                else if (calibration.CalibrationOperation == (decimal)CalibrationOperation.Zarb)
                {
                    calibrationX.CalibrationOperationString = "ضرب";
                }

                result.Add(calibrationX);
            }

            return(result);
        }
Example #3
0
 private void gridView_SelectionChanged_1(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
 {
     LastSelected = gridView.SelectedItem as Calibration2;
 }