예제 #1
0
        public void onClick_Commit(object obj)
        {
            Borderou created = new Borderou(WebsiteValue, int.Parse(FacturaValue));

            BorderouList.Add(created);
            UpdateSummary();
            _addBorderouEntry.Close();
        }
예제 #2
0
        public void OnClick_ApplyFilter(object obj)
        {
            SumaCostCurier       = 0;
            SumaTransportFactura = 0;
            SumaValoareFactura   = 0;
            string[] startDates = StartDate.Split('/');
            string[] endDates   = EndDate.Split('/');
            string   startDay   = startDates[1];

            if (startDay.Length == 1)
            {
                startDay = "0" + startDay;
            }
            string startMonth = startDates[0];

            if (startMonth.Length == 1)
            {
                startMonth = "0" + startMonth;
            }
            string startYear = startDates[2].Substring(0, startDates[2].IndexOf(" "));
            string endDay    = endDates[1];

            if (endDay.Length == 1)
            {
                endDay = "0" + endDay;
            }
            string endMonth = endDates[0];

            if (endMonth.Length == 1)
            {
                endMonth = "0" + endMonth;
            }
            string endYear = endDates[2].Substring(0, endDates[2].IndexOf(" "));

            DateTime from = new DateTime(int.Parse(startYear), int.Parse(startMonth), int.Parse(startDay));
            DateTime to   = new DateTime(int.Parse(endYear), int.Parse(endMonth), int.Parse(endDay));

            criteria = new List <Predicate <Borderou> >();
            criteria.Add(new Predicate <Borderou>(x => from <= x.FacturaData && x.FacturaData <= to));
            List <Borderou> selectedBorderouList = BorderouList.Where(i => from <= i.FacturaData && i.FacturaData <= to).ToList();

            foreach (Borderou borderou in selectedBorderouList)
            {
                SumaCostCurier       += borderou.CurierCost;
                SumaTransportFactura += borderou.FacturaTransport;
                SumaValoareFactura   += borderou.FacturaValoare;
            }
            string stPropName = WpfUtils.GetPropertyName(() => this.SumaCostCurier);

            NotifyPropertyChanged(stPropName);
            stPropName = WpfUtils.GetPropertyName(() => this.SumaTransportFactura);
            NotifyPropertyChanged(stPropName);
            stPropName = WpfUtils.GetPropertyName(() => this.SumaValoareFactura);
            NotifyPropertyChanged(stPropName);
            BorderouView.Filter = DynamicFilter;
        }
예제 #3
0
 private void OnClick_DeleteEntry(object obj)
 {
     if (MessageBox.Show("Confirmi stergerea?", "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         List <Borderou> selectedBorderouList = BorderouList.Where(i => i.IsSelected == true).ToList();
         foreach (Borderou borderou in selectedBorderouList)
         {
             BorderouList.Remove(borderou);
         }
         UpdateSummary();
     }
 }