Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            goodsId           = Request.QueryString["goodsId"] == null ? 0 : Int32.Parse(Request.QueryString["goodsId"]);
            GoodsIdInput.Text = "<input type='hidden' id='formGooodsId' name='formGooodsId' value='" + goodsId.ToString() + "' />";

            GoodsBll    gb       = new GoodsBll();
            List <Sort> sortList = gb.GetSort();
            string      html     = "";

            foreach (Sort sort in sortList)
            {
                html += "<option value='" + sort.SortId.ToString() + "'>" + sort.SortName + "</option>";
            }
            SortListSelect.Text = html;

            if (goodsId != 0)
            {
                Goods currentGoods = gb.GetSingleGoods(goodsId);
                goodsName    = currentGoods.GoodsName;
                sortId       = currentGoods.SortId;
                goodsPrice   = currentGoods.Price.ToString("f2");
                goodsCost    = currentGoods.Cost.ToString("f2");
                goodsOnsales = currentGoods.Onsale;
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            GoodsBll     gb        = new GoodsBll();
            List <Sort>  sortList  = gb.GetSort();
            List <Goods> goodsList = gb.GetAllGoodsOrderByName();
            string       html      = "";

            foreach (Sort tempSort in sortList)
            {
                html += "<option value='" + tempSort.SortId.ToString() + "'>" + tempSort.SortName + "</option>";
            }
            FormSortIdSelect.Text = html;
            html = "";
            foreach (Goods tempGoods in goodsList)
            {
                html += "<option sortTag='" + tempGoods.SortId.ToString() + "' price='" + tempGoods.Price.ToString("f2") + "' value='" + tempGoods.GoodsId.ToString() + "'>" + tempGoods.GoodsName + "</option>";
            }
            FormGoodsIdSelect.Text = html;

            int saleId = Request.QueryString["saleId"] == null ? 0 : Int32.Parse(Request.QueryString["saleId"]);

            SaleIdInput.Text = "<input type='hidden' id='formSaleId' name='formSaleId' value='" + saleId.ToString() + "' />";
            frontSaleId      = saleId;
            if (saleId != 0)
            {
                SaleBll sb      = new SaleBll();
                Sale    saleObj = sb.GetSingleSale(saleId);
                SaleNumberInput.Text = "<input type='hidden' id='formSaleNumber' name='formSaleNumber' value='" + saleObj.SaleNumber + "' />";
                frontSortId          = saleObj.SortId;
                frontGoodsId         = saleObj.GoodsId;
                frontSalePrice       = saleObj.SalePrice;
                frontSaleCount       = saleObj.SaleCount;
                frontSaleUnit        = saleObj.SaleUnit;
                frontSaleDate        = saleObj.SaleDate;
            }
            else
            {
                SaleNumberInput.Text = "<input type='hidden' id='formSaleNumber' name='formSaleNumber' value='' />";
            }
        }