protected void gvProducts_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Delete")
                {
                    // get the ID of the clicked row
                    int ID = Convert.ToInt32(e.CommandArgument);

                    FBFoodInventoryController controller = new FBFoodInventoryController();
                    // Delete the record
                    controller.FBProducts_Delete(ID);

                    FillProductsGrid();
                }


                if (e.CommandName == "Edit")
                {
                    int ID = Convert.ToInt32(e.CommandArgument);


                    FBFoodInventoryController controller = new FBFoodInventoryController();
                    FBFoodInventoryInfo       item       = controller.FBProducts_GetByID(this.ModuleId, ID);

                    if (item != null)
                    {
                        panelGrid.Visible   = false;
                        panelEdit.Visible   = true;
                        txtProductName.Text = item.ProductName.ToString();
                        txtCasePrice.Text   = string.Format("{0:0.00}", item.CasePrice.ToString());
                        //txtCasePrice.Text = item.CasePrice.ToString();
                        txtCaseCount.Text = item.CaseCount.ToString();
                        ddlProductCategory.SelectedValue = item.ProductCategoryID.ToString();
                        txtCaseWeight.Text        = item.CaseWeight.ToString();
                        rblIsActive.SelectedValue = item.IsActive.ToString();
                        txtProductID.Value        = item.ProductID.ToString();
                    }
                    else
                    {
                        txtProductID.Value = "";
                    }
                }
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
        protected void ddlProducts_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                int productID = Int32.Parse(ddlProducts.SelectedValue.ToString());

                FBFoodInventoryController controller = new FBFoodInventoryController();
                FBFoodInventoryInfo       item       = controller.FBProducts_GetByID(this.ModuleId, productID);

                if (item != null)
                {
                    txtPricePerCaseAddNewEdit.Text  = item.CasePrice.ToString();
                    txtCountPerCaseAddNewEdit.Text  = item.CaseCount.ToString();
                    txtWeightPerCaseAddNewEdit.Text = item.CaseWeight.ToString();
                }
                txtCasesAddNewEdit.Focus();
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }