コード例 #1
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                FBFoodInventoryController controller = new FBFoodInventoryController();
                FBFoodInventoryInfo       item       = new FBFoodInventoryInfo();

                item.SupplierName    = txtContent.Text;
                item.SupplierID      = itemId;
                item.ModuleId        = this.ModuleId;
                item.CreatedByUserID = this.UserId;

                //determine if we are adding or updating
                if (Null.IsNull(item.SupplierID))
                {
                    controller.FBSuppliers_Insert(item);
                }
                else
                {
                    controller.FBSuppliers_Update(item);
                }

                Response.Redirect(Globals.NavigateURL(), true);
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
コード例 #2
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.SupplierName = txtSupplierName.Text.ToString();
                //     item.GBFB = Convert.ToBoolean(cbxGBFB.Checked);
                item.Address              = txtAddress.Text.ToString();
                item.City                 = txtCity.Text.ToString();
                item.State                = ddlState.SelectedValue.ToString();
                item.Zip                  = txtZip.Text.ToString();
                item.SupplierPhone        = txtSupplierPhone.Text.ToString();
                item.Salesman             = txtSalesman.Text.ToString();
                item.SalesmanPhone        = txtSalesmanPhone.Text.ToString();
                item.LastModifiedByUserID = this.UserId;

                item.IsActive = Convert.ToBoolean(rblIsActive.SelectedValue.ToString());

                if (txtSupplierID.Value.Length > 0)
                {
                    item.SupplierID = Int32.Parse(txtSupplierID.Value.ToString());
                    controller.FBSuppliers_Update(item);
                }
                else
                {
                    item.CreatedByUserID = this.UserId;
                    controller.FBSuppliers_Insert(item);
                }


                Response.Redirect(EditUrl("Suppliers"));
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }