Example #1
0
        public void RecalculateFilteredPriceLists(int keyPriceListId = 0)
        {
            List <PricingEverydayPriceList> includedLists = PriceLists.ToList();

            if (keyPriceListId > 0)
            {
                var keyPriceList = PriceLists.Where(p => p.Id == keyPriceListId).FirstOrDefault();
                if (keyPriceList != null)
                {
                    short keySort = keyPriceList.Sort;
                    includedLists = includedLists.Where(p => p.Sort > keySort).ToList();
                    includedLists.ForEach(item => item.CanChangeIsSelected = true);

                    //Price lists above the key price list cannot be marked IsSelected.
                    var excludedLists = PriceLists.Where(p => p.Sort < keySort);
                    foreach (PricingEverydayPriceList priceList in excludedLists)
                    {
                        priceList.IsSelected          = false;
                        priceList.CanChangeIsSelected = false;
                    }
                }
            }

            FilteredPriceLists = new ObservableCollection <PricingEverydayPriceList>(includedLists);
        }
Example #2
0
        private async void FetchData()
        {
            priceLists = await FetchPriceListsData();

            user.stashTabs = await FetchStashTabsData();

            RaiseEvents("StashTabs");
            user.userId = await FetchUserId();

            user.parties = await FetchParties(user.userId);

            RaiseEvents("Parties");
        }
Example #3
0
        public void AddPriceList(PriceListModel addedPriceList)
        {
            PriceLists.Add(addedPriceList);

            foreach (var productModel in Products)
            {
                productModel.Prices.Add(new PriceModel
                {
                    ProductId   = productModel.ProductId,
                    PriceListId = addedPriceList.PriceListId
                });
            }

            RaisePropertyChanged(nameof(AddablePriceLists));
        }
Example #4
0
    protected void m_grid_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string message = "";

        try
        {
            PriceLists m_PriceLists = new PriceLists();
            m_PriceLists.PriceList = System.Int32.Parse(m_grid.DataKeys[e.RowIndex].Value.ToString());
            m_PriceLists.Delete();
        }
        catch (Exception ex)
        {
            sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name);
        }
        ShowGrid();
    }
Example #5
0
    //--------------------------------------------------------------------------------

    private void ShowGrid()
    {
        try
        {
            PriceLists m_PriceLists = new PriceLists();
            m_PriceLists.PriceListName = txtSearch.Text;
            string            DateFrom     = txtDateFrom.Text;
            string            DateTo       = txtDateTo.Text;
            int               RowCount     = 0;
            List <PriceLists> l_PriceLists = m_PriceLists.GetPage("", "", ddlOrderBy.SelectedValue, m_grid.PageSize, CustomPaging.PageIndex - 1, ref RowCount);

            m_grid.DataSource = l_PriceLists;
            m_grid.DataBind();
            lblTong.Text           = RowCount.ToString();
            CustomPaging.TotalPage = (RowCount == 0) ? 1 : (RowCount % m_grid.PageSize == 0) ? RowCount / m_grid.PageSize : (RowCount - RowCount % m_grid.PageSize) / m_grid.PageSize + 1;
        }
        catch (Exception ex)
        {
            sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name);
        }
    }
Example #6
0
        private async Task <PriceLists> FetchPriceListsData()
        {
            PriceLists priceLists = new PriceLists();

            foreach (Category category in Enum.GetValues(typeof(Category)))
            {
                string link = $"https://api.poe.watch/get?league={user.league}&category={category}";

                try
                {
                    var responseString = await webservice.httpClient.GetStringAsync(link);

                    priceLists.prices.Add(new JavaScriptSerializer().Deserialize <List <Item> >(responseString));
                }
                catch (HttpRequestException e)
                {
                    throw e;
                }
            }

            return(priceLists);
        }
Example #7
0
 private void bindData()
 {
     System.Int32 EditId;
     if (Request.QueryString["id"] == null)
     {
         return;
     }
     else
     {
         EditId = System.Int32.Parse(Request.QueryString["id"].ToString());
         PriceLists m_PriceLists = new PriceLists();
         m_PriceLists.PriceList = EditId;
         m_PriceLists           = m_PriceLists.Get();
         txPriceListName.Text   = m_PriceLists.PriceListName.ToString();
         txPriceListDesc.Text   = m_PriceLists.PriceListDesc.ToString();
         txPriceListTypeId.Text = m_PriceLists.PriceListTypeId.ToString();
         txIsDetail.Text        = m_PriceLists.IsDetail.ToString();
         txStatusId.Text        = m_PriceLists.StatusId.ToString();
         txDisplayOrder.Text    = m_PriceLists.DisplayOrder.ToString();
         txCrUserId.Text        = m_PriceLists.CrUserId.ToString();
         txCrDateTime.Text      = m_PriceLists.CrDateTime.ToString("dd/MM/yyyy");
     }
 }
Example #8
0
 protected void lbDelete_Click(object sender, EventArgs e)
 {
     try
     {
         PriceLists m_PriceLists = new PriceLists();
         foreach (GridViewRow m_Row in m_grid.Rows)
         {
             CheckBox chkAction = (CheckBox)m_Row.FindControl("chkAction");
             if (chkAction != null)
             {
                 if (chkAction.Checked)
                 {
                     m_PriceLists.PriceList = System.Int32.Parse(m_grid.DataKeys[m_Row.RowIndex].Value.ToString());
                     m_PriceLists.Delete();
                 }
             }
         }
         ShowGrid();
     }
     catch (Exception ex)
     {
         sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name);
     }
 }
Example #9
0
    public void LoadItem()
    {
//        MySave m_Save = SaveSystem.Loaded();
        List <int> itemListData = new List <int>();

        PriceLists priceLists = Resources.Load <PriceLists>("Prefab/PriceLists");

        switch (cT)
        {
        case ClothesType.Accessories:
            priceListData.AddRange(priceLists.accessoriesPrices);
            CloneItemClothesType(Atlas.Ins.GetSprites(Atlas.Ins.clothesPre.ac), (int)ClothesType.Accessories);
            break;

        case ClothesType.Shirts:
            priceListData.AddRange(priceLists.shirtPrices);
            CloneItemClothesType(Atlas.Ins.GetSprites(Atlas.Ins.clothesPre.shirt), (int)ClothesType.Shirts);
            break;

        case ClothesType.Pants:
            priceListData.AddRange(priceLists.pantPrices);
            CloneItemClothesType(Atlas.Ins.GetSprites(Atlas.Ins.clothesPre.pant), (int)ClothesType.Pants);
            break;

        case ClothesType.Shoes:
            priceListData.AddRange(priceLists.shoePrices);
            CloneItemClothesType(Atlas.Ins.GetSprites(Atlas.Ins.clothesPre.shoe), (int)ClothesType.Shoes);
            break;
        }

        switch (fT)
        {
        case FurnitureType.Decoration:
            priceListData.AddRange(priceLists.decorationPrices);
            CloneItemFurnitureType(Atlas.Ins.GetSprites(Atlas.Ins.furPre.decoration), (int)FurnitureType.Decoration);
            break;

        case FurnitureType.Bed:
            priceListData.AddRange(priceLists.bedPrices);
            CloneItemFurnitureType(Atlas.Ins.GetSprites(Atlas.Ins.furPre.bed), (int)FurnitureType.Bed);
            break;

        case FurnitureType.Windows:
            priceListData.AddRange(priceLists.windowPrices);
            CloneItemFurnitureType(Atlas.Ins.GetSprites(Atlas.Ins.furPre.furniture), (int)FurnitureType.Windows);

            break;

        case FurnitureType.Floor:
            priceListData.AddRange(priceLists.floorPrices);
            CloneItemFurnitureType(Atlas.Ins.GetSprites(Atlas.Ins.furPre.floor), (int)FurnitureType.Floor);
            break;

        case FurnitureType.Wallpaper:
            priceListData.AddRange(priceLists.wallpaperPrices);
            CloneItemFurnitureType(Atlas.Ins.GetSprites(Atlas.Ins.furPre.wallpaper), (int)FurnitureType.Wallpaper);
            break;

        case FurnitureType.Toy:
            priceListData.AddRange(priceLists.toyPrices);
            CloneItemFurnitureType(Atlas.Ins.GetSprites(Atlas.Ins.furPre.other), (int)FurnitureType.Toy);

            break;
        }

        switch (foodT)
        {
        case FoodType.Food:
            priceListData.AddRange(priceLists.foodPrices);
            CloneItemFoodType(Atlas.Ins.GetSprites(Atlas.Ins.food.food));
            break;
        }
    }
Example #10
0
 public void AddPriceList(object attachment)
 {
     PriceLists.Add((PriceListAttachment)attachment);
 }
Example #11
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        byte SysMessageTypeId = 0;
        int  SysMessageId     = 0;

        System.Int32 EditId;
        PriceLists   m_PriceLists = new PriceLists();

        if (Request.QueryString["id"] == null)
        {
            EditId = 0;
        }
        else
        {
            EditId = System.Int32.Parse(Request.QueryString["id"].ToString());
            m_PriceLists.PriceList = EditId;
            m_PriceLists           = m_PriceLists.Get();
        }
        try
        {
            if (txPriceListName.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }


            m_PriceLists.CrUserId = ActUserId;

            if (txPriceListName.Text != "")
            {
                m_PriceLists.PriceListName = txPriceListName.Text;
            }

            if (txPriceListDesc.Text != "")
            {
                m_PriceLists.PriceListDesc = txPriceListDesc.Text;
            }

            m_PriceLists.PriceListTypeId = byte.Parse(txPriceListTypeId.Text);

            m_PriceLists.IsDetail = byte.Parse(txIsDetail.Text);

            m_PriceLists.StatusId = byte.Parse(txStatusId.Text);

            m_PriceLists.DisplayOrder = int.Parse(txDisplayOrder.Text);

            m_PriceLists.UpdateUserId = int.Parse(txUpdateUserId.Text);

            m_PriceLists.PriceList = EditId;
            SysMessageTypeId       = m_PriceLists.InsertOrUpdate(ConstantHelpers.Replicated, ActUserId, ref SysMessageId);

            StringBuilder       csText = new StringBuilder();
            Type                cstype = this.GetType();
            ClientScriptManager cs     = Page.ClientScript;
            csText.Clear();
            csText.Append("<script type=\"text/javascript\">");
            csText.Append("window.parent.jQuery('#divEdit').dialog('close');");
            csText.Append("</script>");
            cs = Page.ClientScript;
            cs.RegisterClientScriptBlock(this.GetType(), "system_message", csText.ToString());
        }
        catch (Exception ex)
        {
            sms.utils.LogFiles.LogError(((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name + "\t" + ex.ToString());
            JSAlertHelpers.Alert(ex.Message, this);
        }
    }