Ejemplo n.º 1
0
        private void RefreshData()
        {
            IPurchaseOrderListRepository purchaseRepository = new PurchaseOrderListRepository();

            this.DateFormat   = purchaseRepository.GetDateFormat();
            this.ShowAllCount = purchaseRepository.GetAllPurOrder().Count();
            GetOptionsandTaxValues();
            this.JsonData             = purchaseRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.PurchaseOrderList));
            this.PurchaseOrderList    = purchaseRepository.GetAllPurOrderJson(this.JsonData, this.IncludingGSTTrue).OrderBy(e => e.SupplierName).ToList();
            this.ShowSelectedCount    = this.PurchaseOrderList.Count();
            this.PurchaseOrderListcmb = purchaseRepository.GetAllPurOrder().OrderBy(e => e.SupplierName).ToList();
            this.YearRange            = purchaseRepository.GetYearRange().ToList();
            //changedateformat(this.PurchaseOrderList);
            changeNumberformat(this.PurchaseOrderList);
            changeNumberformat(this.PurchaseOrderListcmb);
            DefaultList = this.PurchaseOrderListcmb;
            FullPQList  = this.PurchaseOrderListcmb;

            this.PurchaseOrderListcmbSup = this.PurchaseOrderList.GroupBy(x => x.SupplierName).Select(y => y.First()).OrderBy(x => x.SupplierName).Distinct().ToList();
            this.PurchaseOrderListcmbONo = this.PurchaseOrderList.GroupBy(x => x.OrderNo).Select(y => y.First()).OrderBy(x => x.SortOrderNo).Distinct().ToList();
            //this.ShowAllCount = this.PurchaseOrderListcmb.Count();
            SetDefaultSearchSelection(this.JsonData);
            var    Updateddate = this.PurchaseOrderListcmb.Max(x => x.CreatedDateList);
            string date        = this.DateFormat as string;

            this.LastUpdateDate = Convert.ToDateTime(Updateddate).ToString(date);

            TotalAmount  = Convert.ToString(PurchaseOrderList.Sum(e => e.OAmount));
            DepositTotal = Convert.ToString(PurchaseOrderList.Sum(e => e.DAmount));

            //this.GetData(this.SelectedSearchSupplier);
        }
Ejemplo n.º 2
0
        void showexcGST(object param)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            int decimalpoints = Convert.ToInt32(this.DecimalPlaces);
            IPurchaseOrderListRepository purchaseRepository = new PurchaseOrderListRepository();

            this.PurchaseOrderList = purchaseRepository.GetAllPurOrderJson(this.JsonData, this.IncludingGSTTrue).ToList();
            if (this.ShowAllTrue == false)
            {
                this.ShowSelectedCount = this.PurchaseOrderList.Count();
            }
            else
            {
                this.ShowSelectedCount = 0;
            }
            this.PurchaseOrderListcmb    = this.PurchaseOrderList;
            this.PurchaseOrderListcmbSup = this.PurchaseOrderList.GroupBy(x => x.SupplierName).Select(y => y.First()).OrderBy(x => x.SupplierName).Distinct().ToList();
            this.PurchaseOrderListcmbONo = this.PurchaseOrderList.GroupBy(x => x.OrderNo).Select(y => y.First()).OrderBy(x => x.SortOrderNo).Distinct().ToList();
            DefaultList = this.PurchaseOrderListcmb;
            //changedateformat(this.PurchaseOrderList);
            //changeNumberformat(this.PurchaseOrderList);
            Mouse.OverrideCursor = null;
        }
Ejemplo n.º 3
0
        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.PurchaseOrderListInternal = DefaultList.Where(x => x.ExcIncGST == true).ToList();
                    //else
                    //    this.PurchaseOrderListInternal = DefaultList.Where(x => x.ExcIncGST == false).ToList();
                    //this.PurchaseOrderListcmb = DefaultList;
                }
                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;
                    }

                    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);
                }
                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);


                    SearchValues.Add(value);
                    SearchValues.Add(value1);
                }

                jsonSearch    = JsonConvert.SerializeObject(SearchValues);
                this.JsonData = jsonSearch;

                IPurchaseOrderListRepository purchaseRepository = new PurchaseOrderListRepository();
                var results = purchaseRepository.SaveSearchJson(jsonSearch, Convert.ToInt32(ScreenId.PurchaseOrderList), "Purhcase_Order_List");
                if (Count != 0)
                {
                    this.PurchaseOrderList = purchaseRepository.GetAllPurOrderJson(jsonSearch, this.IncludingGSTTrue);
                    //changedateformat(this.PurchaseOrderList);
                    changeNumberformat(this.PurchaseOrderList);
                }

                this.PurchaseOrderListcmb    = this.PurchaseOrderList.OrderBy(e => e.SupplierName).ToList();
                this.PurchaseOrderListcmbSup = this.PurchaseOrderList.GroupBy(x => x.SupplierName).Select(y => y.First()).OrderBy(x => x.SupplierName).Distinct().ToList();
                this.PurchaseOrderListcmbONo = this.PurchaseOrderList.GroupBy(x => x.OrderNo).Select(y => y.First()).OrderBy(x => x.SortOrderNo).Distinct().ToList();
                if (this.ShowAllTrue == true)
                {
                    this.ShowSelectedCount = 0;
                }
                else
                {
                    this.ShowSelectedCount = this.PurchaseOrderList.Count();
                }
                DefaultList = this.PurchaseOrderListcmb;

                TotalAmount  = Convert.ToString(PurchaseOrderList.Sum(e => e.OAmount));
                DepositTotal = Convert.ToString(PurchaseOrderList.Sum(e => e.DAmount));
            }
        }