protected void Page_Load(object sender, EventArgs e)
    {
        string code = Master.TextBoxCode.Text.Trim();

        Master.TextBoxCode.Text = "";

        if (code.Length == 0)
        {
            return;
        }


        if (rdbProductCodeIn.Checked)
        {
            if (BarcodeBLL.IsValidProductCode(code))
            {
                ProductCodeInList = receiptBLL.AddProductCodeIn(BarcodeBLL.ParseProductCode(code));
                DataListProductIn.DataBind();
            }
        }
        else if (rdbProductCodeOut.Checked)
        {
            if (BarcodeBLL.IsValidProductCode(code))
            {
                ProductCodeOutList = receiptBLL.AddProductCodeOut(BarcodeBLL.ParseProductCode(code));
                DataListProductOut.DataBind();
            }
        }
    }
    protected void btnProductCodeOut_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton btn = sender as ImageButton;

        if (btn != null)
        {
            ProductCodeOutList.Remove(btn.CommandArgument);
            DataListProductOut.DataBind();
        }
    }
Beispiel #3
0
        protected void btnReset_Click(object sender, EventArgs e)
        {
            ProductCodeInList.Clear();
            DataListProductIn.DataBind();

            ProductCodeOutList.Clear();
            DataListProductOut.DataBind();

            DINInList.Clear();
            DataListDINIn.DataBind();

            rdbProductCodeOut.Checked = false;
            rdbDINIn.Checked          = false;
            rdbProductCodeIn.Checked  = true;
        }
    public void DisplayToGUI()
    {
        Receipt e = ReceiptBLL.Get(ReceiptID);

        if (e == null)
        {
            e = new Receipt();
            ProductCodeInList.Clear();
            ProductCodeOutList.Clear();
            rdbProductCodeIn.Checked = true;
        }
        else
        {
            ProductCodeInList  = e.ReceiptProducts.Where(r => r.Type == ReceiptProduct.TypeX.In).Select(r => r.ProductCode).ToList();
            ProductCodeOutList = e.ReceiptProducts.Where(r => r.Type == ReceiptProduct.TypeX.Out).Select(r => r.ProductCode).ToList();
        }

        txtName.Text = e.Name;
        txtNote.Text = e.Note;

        DataListProductIn.DataBind();
        DataListProductOut.DataBind();
    }