Ejemplo n.º 1
0
    public string LoadProductInfo()
    {
        string tableRow = "";

        try
        {
            tableRow = new ProductEntryBLL().LoadProductInfo();
        }
        catch (Exception ex)
        {
        }
        return(tableRow.ToString());
    }
Ejemplo n.º 2
0
    protected void submitButton_Click(object sender, EventArgs e)
    {
        Products        product    = new Products();
        ProductEntryBLL productBll = new ProductEntryBLL();

        try
        {
            product.ProductName = productNameTextBox.Text;
            // product.ProductType = productTypeTextBox.Text;
            if (productNameTextBox.Text == "" || productNameTextBox.Text == null)
            {
                messageLabel.Text = "Please Enter Product Name..";
                table             = LoadProductInfo();
            }
            //else if (productTypeTextBox.Text == "" || productTypeTextBox.Text == null)
            //{
            //    messageLabel.Text = "Please Enter Product Type..";
            //    table = LoadProductInfo();
            //}
            else
            {
                actionResult = productBll.InsertProductInfo(product);
                if (actionResult == 1)
                {
                    messageLabel.Text = "Product Information Has Been Sucessfully Inserted...";
                    //productTypeTextBox.Text = "";
                    productNameTextBox.Text = "";
                    table = LoadProductInfo();
                }
                else
                {
                    messageLabel.Text = "Operation failed...";
                    table             = LoadProductInfo();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }