protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(hfId.Value))
     {
         try
         {
             ProductFacade facade = new ProductFacade();
             int id = Convert.ToInt32(hfId.Value);
             facade.Delete(id);
             gvProducts.DataBind();
             lblErrorMessage.Text = Helper.DeleteRecordMessage(true);
         }
         catch (Exception exception)
         {
             lblErrorMessage.Text = Helper.DeleteRecordMessage(false);
         }
     }
 }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        ProductFacade facade = new ProductFacade();
        int? id = null;
        if (!String.IsNullOrEmpty(txtOuterDiameter.Text))
            OuterDiameter = Convert.ToDecimal(txtOuterDiameter.Text);
        if (!String.IsNullOrEmpty(txtInnerDiameter.Text))
            InnerDiameter = Convert.ToDecimal(txtInnerDiameter.Text);
        if (!String.IsNullOrEmpty(txtHeight.Text))
            Height = Convert.ToDecimal(txtHeight.Text);
        if (!String.IsNullOrEmpty(txtWidth.Text))
            Width = Convert.ToDecimal(txtWidth.Text);
        if (!String.IsNullOrEmpty(txtWeight.Text))
            Weight = Convert.ToDecimal(txtWeight.Text);
        if (!String.IsNullOrEmpty(txtLength.Text))
            Length = Convert.ToDecimal(txtLength.Text);

        try
        {
            id = (!String.IsNullOrEmpty(hfId.Value)) ? Convert.ToInt32(hfId.Value) : id;
            facade.Save(id, txtProductCode.Text, Convert.ToInt32(ddlProductGroup.SelectedValue), Convert.ToInt32(ddlCustomers.SelectedValue), Convert.ToInt32(ddlSupplier.SelectedValue), txtProductName.Text, txtDescription.Text, Weight, String.Empty, OuterDiameter, InnerDiameter, Height, Width, Length, null, DateTime.Now, user, user, String.Empty);
            lblErrorMessage.Text = Helper.SaveRecordMessage(true);
        }
        catch (Exception ex)
        {
            lblErrorMessage.Text = Helper.SaveRecordMessage(false);

        }
        gvProducts.DataBind();
        Helper.EnableControls(false, action);
    }