Esempio n. 1
0
        public TodoElementsController(ITodoRepositoryContext context)
        {
            _context     = context;
            _queryHelper = new QueryHelper(context);

            Task.Run(() => DefaultList.CreateAsync(context)).Wait();
        }
Esempio n. 2
0
        private void LoadDataList()
        {
            if (this.DefaultList != null && this.DefaultList.Count > 0)
            {
                DataList = DefaultList;
                if (DefaultList.Where(f => f.Name.ToUpper().Contains(txtData.Text.ToUpper())).Count() == 1)
                {
                    DataList = DefaultList.Where(f => f.Name.ToUpper().Contains(txtData.Text.ToUpper())).ToList();
                }

                return;
            }


            //Search for a Records
            if (this.AccType == AccntType.Vendor)
            {
                DataList = (new WMSServiceClient()).SearchVendor(txtData.Text);
            }
            else
            {
                DataList = (new WMSServiceClient()).SearchCustomer(txtData.Text);
            }

            if (DataList == null || DataList.Count == 0)
            {
                return;
            }
        }
Esempio n. 3
0
        private void txtData_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtData.Text))
            {
                return;
            }

            if (this.DefaultList != null)
            {
                DataList = DefaultList;

                if (DefaultList.Where(f => f.DataKey.ToUpper().StartsWith(txtData.Text.ToUpper())).Count() > 0)
                {
                    DataList = DefaultList.Where(f => f.DataKey.ToUpper().StartsWith(txtData.Text.ToUpper())).ToList();
                }
            }


            if (DataList == null || DataList.Count == 0)
            {
                return;
            }

            //Cargar la lista de Records
            this.cboData.Visibility = Visibility.Visible;
            //this.cboData.IsDropDownOpen = true;

            if (DataList.Count == 1)
            {
                FireEvent(sender, e);
            }
        }
 private void MeetingsList_Select(object sender, EventArgs e)
 {
     if (MeetingsList.SelectedItem != null)
     {
         DefaultList.ClearSelected();
     }
 }
Esempio n. 5
0
 public void InitLoginInfo(User user)
 {
     try
     {
         IsLogin   = true;
         this.user = user;
         //defaultlist
         HistoryMusicList.User_Id = user.User_Id;
         HistoryMusicList         = mDB.GetMusicList(HistoryMusicList);
         LikedMusicList.User_Id   = user.User_Id;
         LikedMusicList           = mDB.GetMusicList(LikedMusicList);
         //createdlist
         AllMusicLists = mDB.GetAllMusicList(user);
         for (int i = 0; i < AllMusicLists.Count(); i++)
         {
             if (DefaultList.Contains(AllMusicLists[i].ListName))
             {
                 continue;
             }
             CreatedMusicList.Add(mDB.GetMusicList(AllMusicLists[i]).ListName, i);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message + ex.StackTrace);
     }
 }
 public async Task Search()
 {
     try
     {
         if (!string.IsNullOrEmpty(SearchInput))
         {
             var search = DefaultList.Where(x => x.Name.ToLower().Contains(SearchInput.ToLower()));
             ListUsers = new ObservableCollection <User>(search);
         }
         else
         {
             ListUsers = DefaultList;
         }
     }
     catch (Exception err)
     {
     }
 }
        private void txtData_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtData.Text))
            {
                return;
            }

            this.C_CasNumber     = null;
            this.C_CasNumberDesc = null;
            //Search for a Records

            if (this.DefaultList != null)
            {
                DataList = DefaultList;
                if (DefaultList.Where(f => f.Code.ToUpper().StartsWith(txtData.Text.ToUpper())).Count() == 1)
                {
                    DataList = DefaultList.Where(f => f.Code.ToUpper().StartsWith(txtData.Text.ToUpper())).ToList();
                }
            }
            else
            {
                DataList = (new WMSServiceClient()).GetC_CasNumber(new C_CasNumber {
                    Name = txtData.Text
                });
            }

            if (DataList == null || DataList.Count == 0)
            {
                return;
            }

            //Cargar la lista de Records
            this.cboData.Visibility     = Visibility.Visible;
            this.cboData.IsDropDownOpen = true;

            if (DataList.Count == 1)
            {
                FireEvent(sender, e);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 重写基类文本事件
        /// </summary>
        protected override void OnTextUpdate(EventArgs e)
        {
            if (_TextSource != null && _TextSource.Count > 0)
            {
                this.Text = this.Text.Replace(",", ",");
                StrAppend = this.Text;
                string input = this.Text.Trim().ToUpper();
                this.Items.Clear();
                if (string.IsNullOrEmpty(input))
                {
                    this.Items.AddRange(DefaultList.ToArray());
                }
                else
                {
                    var newList = _TextSource.Where(T => T.Contains(input)).ToList();
                    if (newList.Count == 0)
                    {
                        this.Items.AddRange(DefaultList.ToArray());
                    }
                    else
                    {
                        for (int i = 0; i < newList.Count; i++)
                        {
                            this.Items.Add(newList[i].Split(',')[0]);
                        }
                    }
                }
                this.Select(this.Text.Length, 0);
                this.DroppedDown = true;

                //保持鼠标指针形状
                Cursor.Current = Cursors.IBeam;
                Cursor.Current = Cursors.Default;
            }
            base.OnTextUpdate(e);
        }
Esempio n. 9
0
        /// <summary>
        /// Creates a continuous natural cubic spline of defect 1.
        /// Max. continuous derivative of the spline is second.
        /// </summary>
        /// <param name="points"></param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static PieceFunction <T, C> CreateNaturalCubicSpline(IList <Point <T> > points, T defaultValue)
        {
            int n = points.Count - 1;   // количество точек

            Numeric <T, C>[] a = new Numeric <T, C> [n];
            Numeric <T, C>[] c = new Numeric <T, C> [n];

            DefaultList <Numeric <T, C> > b = new DefaultList <Numeric <T, C> >(new Numeric <T, C> [n], Numeric <T, C> .Zero);

            Numeric <T, C>[] delta  = new Numeric <T, C> [n];
            Numeric <T, C>[] lambda = new Numeric <T, C> [n];

            Numeric <T, C>[] h    = new Numeric <T, C> [n];
            Numeric <T, C>[] fDiv = new Numeric <T, C> [n];

            KeyValuePair <BoundedInterval <T, C>, IFunction <T, T> >[] pieces = new KeyValuePair <BoundedInterval <T, C>, IFunction <T, T> > [n];

            // count h and fDiv

            for (int i = 0; i < n; i++)
            {
                h[i]    = calc.dif(points[i + 1].X, points[i].X);
                fDiv[i] = calc.dif(points[i + 1].Y, points[i].Y) / h[i];
            }

            // h идут не от 1 до n
            // а от 0 до n-1.

            delta[0]  = (Numeric <T, C>)(-0.5) * h[1] / (h[0] + h[1]);
            lambda[0] = (Numeric <T, C>)(1.5) * (fDiv[1] - fDiv[0]) / (h[0] + h[1]);

            // calculating lambda

            Numeric <T, C> two   = (Numeric <T, C>) 2;
            Numeric <T, C> three = (Numeric <T, C>) 3;

            for (int i = 2; i < n; i++)
            {
                delta[i - 1]  = -h[i] / (two * (h[i - 1] + h[i]) + h[i - 1] * delta[i - 2]);
                lambda[i - 1] = (three * (fDiv[i] - fDiv[i - 1]) - h[i - 1] * lambda[i - 2]) / (two * (h[i - 1] + h[i]) + h[i - 1] * delta[i - 2]);
            }

            // calculating b

            b[n - 1] = Numeric <T, C> .Zero;

            for (int i = n - 1; i > 0; i--)
            {
                b[i - 1] = delta[i - 1] * b[i] + lambda[i - 1];
            }

            // calculating others

            for (int i = 0; i < n; i++)
            {
                a[i] = (b[i] - b[i - 1]) / (three * h[i]);
                c[i] = fDiv[i] + two * h[i] * b[i] / three + h[i] * b[i - 1] / three;

                pieces[i] = new KeyValuePair <BoundedInterval <T, C>, IFunction <T, T> >(
                    new BoundedInterval <T, C>(points[i].X, points[i + 1].X, true, false),
                    new CubicFunction <T, C> (a[i], b[i], c[i], points[i + 1].Y, points[i + 1].X));
            }

            PieceFunction <T, C> function = new PieceFunction <T, C>(defaultValue, pieces);

            function.Type = PieceFunctionType.NaturalCubicSpline;

            return(new PieceFunction <T, C>(defaultValue, pieces));
        }
        void Search(object param)
        {
            if (Count != 0)
            {
                SearchValues = new List <SearchEntity>();
                //this.ShowSelectedTrue = true;
                //this.ShowAllTrue = false;
                if (this.SelectedSearchYear != null || this.SelectedSearchYear == string.Empty)
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Year";
                    value.FieldValue = this.SelectedSearchYear;
                    SearchValues.Add(value);
                    var year = Convert.ToInt32(this.SelectedSearchYear);
                    DefaultList = FullPQList.Where(x => x.CreatedDate.Value.Year == year).ToList();
                    //if (this.IncludingGSTTrue == true)
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == true).ToList();
                    //else
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == false).ToList();
                    this.RefundToCustomersList = DefaultList.OrderBy(x => x.CustomerName).ToList();
                }
                if (this.SelectedSearchQuarter != null || this.SelectedSearchQuarter == string.Empty)
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Quarter";
                    value.FieldValue = this.SelectedSearchQuarter;
                    int month1;
                    int month2;
                    int month3;
                    if (Convert.ToInt32(this.SelectedSearchQuarter) == 1)
                    {
                        month1 = 1;
                        month2 = 2;
                        month3 = 3;
                    }
                    else if (Convert.ToInt32(this.SelectedSearchQuarter) == 2)
                    {
                        month1 = 4;
                        month2 = 5;
                        month3 = 6;
                    }
                    else if (Convert.ToInt32(this.SelectedSearchQuarter) == 3)
                    {
                        month1 = 7;
                        month2 = 8;
                        month3 = 9;
                    }
                    else
                    {
                        month1 = 10;
                        month2 = 11;
                        month3 = 12;
                    }
                    DefaultList = FullPQList.Where(x => x.CreatedDate.Value.Month == month1 || x.CreatedDate.Value.Month == month2 || x.CreatedDate.Value.Month == month3).ToList();
                    //if (this.IncludingGSTTrue == true)
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == true).ToList();
                    //else
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == false).ToList();
                    this.RefundToCustomersList = DefaultList.OrderBy(x => x.CustomerName).ToList();
                    SearchValues.Add(value);
                }
                if (this.SelectedSearchMonth != null || this.SelectedSearchMonth == string.Empty)
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Month";
                    value.FieldValue = this.SelectedSearchMonth;
                    SearchValues.Add(value);
                    var month = Convert.ToInt32(this.SelectedSearchMonth);
                    DefaultList = FullPQList.Where(x => x.CreatedDate.Value.Month == month).ToList();
                    //if (this.IncludingGSTTrue == true)
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == true).ToList();
                    //else
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == false).ToList();
                    this.RefundToCustomersList = DefaultList.OrderBy(x => x.CustomerName).ToList();
                }
                if (this.SelectedSearchStartDate != null && this.SelectedSearchEndDate != null)
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName = "StartDate";
                    //value.FieldValue = this.SelectedSearchStartDate.ToString();
                    value.FieldValue = string.Format("{0:MMM/dd/yyyy}", this.SelectedSearchStartDate);

                    SearchValues.Add(value);
                    //string[] value = new string[2];
                    SearchEntity value1 = new SearchEntity();
                    value1.FieldName = "EndDate";
                    //value1.FieldValue = this.SelectedSearchEndDate.ToString();
                    value1.FieldValue = string.Format("{0:MMM/dd/yyyy}", this.SelectedSearchEndDate);

                    DefaultList = FullPQList.Where(x => x.CreatedDate > this.SelectedSearchStartDate && x.CreatedDate < this.SelectedSearchEndDate).ToList();
                    //if (this.IncludingGSTTrue == true)
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == true).ToList();
                    //else
                    //    this.PurchaseInvoiceListInternal = DefaultList.Where(x => x.ExcIncGST == false).ToList();
                    this.RefundToCustomersList = DefaultList.OrderBy(x => x.CustomerName).ToList();
                    SearchValues.Add(value);
                    SearchValues.Add(value1);
                }
                //if (this.SelectedSearchEndDate != null || this.SelectedSearchEndDate == string.Empty)
                //{
                //    string[] value = new string[2];
                //    value[0] = "EndDate";
                //    value[1] = this.SelectedSearchEndDate;
                //    SearchValues.Add(value);
                //}

                //this.PurchaseInvoiceList = this.PurchaseInvoiceListInternal;
                jsonSearch    = JsonConvert.SerializeObject(SearchValues);
                this.JsonData = jsonSearch;

                IRefundToCustomersListRepository purchaseRepository = new RefundToCustomersListRepository();
                var results = purchaseRepository.SaveSearchJson(jsonSearch, Convert.ToInt32(ScreenId.RefundToCustomersList), "Payments_To_Suppliers_List");
                if (Count != 0)
                {
                    this.RefundToCustomersList = purchaseRepository.GetAllPurInvoiceJson(jsonSearch).OrderBy(x => x.CustomerName).ToList();
                }
                this.RefundToCustomersListcmb      = this.RefundToCustomersList;
                this.RefundToCustomersListcmbDebit = this.RefundToCustomersListcmb.GroupBy(x => x.CashChequeNo).Select(g => g.First()).Where(y => y.CashChequeNo != null).OrderBy(x => x.CashChequeNo).ToList();
                this.RefundToCustomersListcmbSup   = this.RefundToCustomersList.GroupBy(x => x.CustomerName).Select(y => y.First()).Distinct().ToList();
                this.RefundToCustomersListcmbInv   = this.RefundToCustomersList.GroupBy(x => x.InvoiceNo).Select(y => y.First()).Distinct().OrderBy(x => x.InvoiceNo).ToList();
                if (this.ShowAllTrue == true)
                {
                    this.ShowSelectedCount = 0;
                }
                else
                {
                    this.ShowSelectedCount = this.RefundToCustomersList.Count();
                }
                DefaultList = this.RefundToCustomersListcmb;
                changedateformat(this.RefundToCustomersList);
                changedateformat(this.RefundToCustomersListcmb);
                changeNumberformat(this.RefundToCustomersList);
                changeNumberformat(this.RefundToCustomersListcmb);
            }
            TotalCashChequeAmount = Convert.ToString(RefundToCustomersList.Sum(e => e.CashChequeAmount));
            TotalPOPIAmount       = Convert.ToString(RefundToCustomersList.Sum(e => e.InvoiceAmountValue));
        }
Esempio n. 11
0
        public TodoListsController(ITodoRepositoryContext context)
        {
            _context = context;

            Task.Run(() => DefaultList.CreateAsync(context)).Wait();
        }