public void Update() { //create an instance of the SellerShopLine Collection clsSellerShopLineCollection AllSellerShopLines = new clsSellerShopLineCollection(); //validate the data on the Windows Form String Error = AllSellerShopLines.ThisSellerShopLine.Valid(txtEmail.Text, txtProductName.Text, txtPrice.Text, txtQuantity.Text, txtDescription.Text); //if the data is OK then add it to the object if (Error == "") { //find the record to UPDATE AllSellerShopLines.ThisSellerShopLine.Find(mSellerShopLineId); //get the data entered by the user AllSellerShopLines.ThisSellerShopLine.Email = txtEmail.Text; AllSellerShopLines.ThisSellerShopLine.Price = Convert.ToDecimal(txtPrice.Text); AllSellerShopLines.ThisSellerShopLine.Quantity = Convert.ToInt32(txtQuantity.Text); AllSellerShopLines.ThisSellerShopLine.ProductName = Convert.ToString(txtProductName.Text); AllSellerShopLines.ThisSellerShopLine.Description = Convert.ToString(txtDescription.Text); //UPDATE the record AllSellerShopLines.Update(); //All Done so Redirect to the previous Form SellerProductsManageForm SPM = new SellerProductsManageForm(); this.Hide(); SPM.ShowDialog(); this.Close(); } else { lblError.Text = "There were problems with the data entered: " + Error; } }
public void Update() { //create an instance of the Inventory Collection clsSellerShopLineCollection AllSellerShopLines = new clsSellerShopLineCollection(); //validate the data on the Windows Form string Error = AllSellerShopLines.ThisSellerShopLine.Valid(txtEmail.Text, Convert.ToString(DDListProductName.SelectedValue), txtNewPrice.Text, txtQuantity.Text, txtDescription.Text); //if the data is OK then add it to the object if (Error == "") { //find the record to UPDATE AllSellerShopLines.ThisSellerShopLine.Find(mSellerShopLineId); //get the data entered by the user AllSellerShopLines.ThisSellerShopLine.ProductName = Convert.ToString(DDListProductName.SelectedValue); AllSellerShopLines.ThisSellerShopLine.Email = txtEmail.Text; AllSellerShopLines.ThisSellerShopLine.Price = Convert.ToDecimal(txtNewPrice.Text); AllSellerShopLines.ThisSellerShopLine.Quantity = Convert.ToInt32(txtQuantity.Text); AllSellerShopLines.ThisSellerShopLine.Description = txtDescription.Text; AllSellerShopLines.ThisSellerShopLine.Active = Convert.ToBoolean(chkVerifyAge.Checked); //UPDATE the record AllSellerShopLines.Update(); //All Done so Redirect to the previous Form } else { lblError.Text = "There were problems with the data entered: " + Error; } }