Exemple #1
0
    public string LoadFabricInfo()
    {
        string tableRow = "";

        try
        {
            tableRow = new FabricsEntryBLL().LoadFabricsInfo();
        }
        catch (Exception ex)
        {
        }
        return(tableRow.ToString());
    }
Exemple #2
0
    protected void submitButton_Click(object sender, EventArgs e)
    {
        Fabrics         fabric    = new Fabrics();
        FabricsEntryBLL fabricBLL = new FabricsEntryBLL();

        try
        {
            fabric.FabricType = fabricTypeTextBox.Text;
            fabric.FabricName = fabricNameTextBox.Text;

            if (fabricTypeTextBox.Text == "" || fabricTypeTextBox.Text == null)
            {
                messageLabel.Text = "Please Enter Fabric Type..";
                table             = LoadFabricInfo();
            }
            else if (fabricNameTextBox.Text == "" || fabricNameTextBox.Text == null)
            {
                messageLabel.Text = "Please Enter Fabric Name..";
                table             = LoadFabricInfo();
            }
            else
            {
                actionResult = fabricBLL.InsertFabricInfo(fabric);
                if (actionResult == 1)
                {
                    messageLabel.Text      = "Fabric Information Has Been Sucessfully Inserted...";
                    fabricTypeTextBox.Text = "";
                    fabricNameTextBox.Text = "";
                    table = LoadFabricInfo();
                }
                else
                {
                    messageLabel.Text = "Operation failed...";
                    table             = LoadFabricInfo();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }