Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                FBFoodInventoryController controller = new FBFoodInventoryController();
                FBFoodInventoryInfo       item       = new FBFoodInventoryInfo();


                item.ModuleId = this.ModuleId;
                item.PortalId = this.PortalId;

                item.ProductName = txtProductName.Text.ToString();

                item.CaseWeight        = double.Parse(txtCaseWeight.Text.ToString());
                item.CasePrice         = double.Parse(txtCasePrice.Text.ToString());
                item.CaseCount         = Int32.Parse(txtCaseCount.Text.ToString());
                item.ProductCategoryID = Int32.Parse(ddlProductCategory.SelectedValue.ToString());

                item.LastModifiedByUserID = this.UserId;
                item.IsActive             = bool.Parse(rblIsActive.SelectedValue.ToString());


                if (txtProductID.Value.Length > 0)
                {
                    item.ProductID = Int32.Parse(txtProductID.Value.ToString());
                    controller.FBProducts_Update(item);
                }
                else
                {
                    item.CreatedByUserID = this.UserId;
                    controller.FBProducts_Insert(item);
                }


                //Response.Redirect(EditUrl("Products"));
                ResetForm();
                FillProductsGrid();
                panelGrid.Visible = true;
                panelEdit.Visible = false;
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }