void Add() { //create an instance of the Payment Collenction clsSellerShopLineCollection AllSellerProducts = new clsSellerShopLineCollection(); //validate the data on the web form string Error = AllSellerProducts.ThisSellerShopLine.Valid(txtEmail.Text, Convert.ToString(DDListProductName.SelectedValue), txtPrice.Text, txtQuantity.Text, txtDescription.Text); //if the data is OK then add it to the object if (Error == "") { //get the data entered by the user AllSellerProducts.ThisSellerShopLine.Email = Convert.ToString(txtEmail.Text); AllSellerProducts.ThisSellerShopLine.ProductName = Convert.ToString(DDListProductName.SelectedValue); AllSellerProducts.ThisSellerShopLine.Price = Convert.ToDecimal(txtPrice.Text); AllSellerProducts.ThisSellerShopLine.Quantity = Convert.ToInt32(txtQuantity.Text); AllSellerProducts.ThisSellerShopLine.Description = txtDescription.Text; AllSellerProducts.ThisSellerShopLine.Active = Convert.ToBoolean(chkVerifyAge.Checked); //add the record AllSellerProducts.Add(); } else { //report an error lblError.Text = "There were problems with the data entered : " + Error; } }
void Add() { //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 the data is OK then add it to the object if (Error == "") { //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); //add the record AllSellerShopLines.Add(); //All Done so Redirect to the previous Form SellerProductsManageForm SPM = new SellerProductsManageForm(); this.Hide(); SPM.ShowDialog(); this.Close(); } else { //report an error 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; } }
void DeleteSellerProduct() { //function to delete the selected record //create an instance of the Inventory List clsSellerShopLineCollection AllSellerShopLines = new clsSellerShopLineCollection(); //find the record to delete AllSellerShopLines.ThisSellerShopLine.Find(mSellerShopLineId); //delete the record AllSellerShopLines.Delete(); }
Int32 DisplaySellerProducts(string EmailFilter) { clsSellerShopLineCollection AllSellerShopLines = new clsSellerShopLineCollection(); AllSellerShopLines.ReportByEmail(EmailFilter); //set the data source to the list of Inventories in the collection lstSellerProducts.DataSource = AllSellerShopLines.SellerShopLineList; //set the name of the primary Key lstSellerProducts.ValueMember = "SellerShopLineId"; //set the data field to display lstSellerProducts.DisplayMember = "AllDetails"; return(AllSellerShopLines.Count); }
public void DisplaySellerProduct() { //create an instance of the SellerShopLine Collection clsSellerShopLineCollection AllSellerShopLines = new clsSellerShopLineCollection(); //find the record from the database to UPDATE AllSellerShopLines.ThisSellerShopLine.Find(mSellerShopLineId); //Display the data for this record txtSellerShopLineId.Text = AllSellerShopLines.ThisSellerShopLine.SellerShopLineId.ToString(); txtEmail.Text = AllSellerShopLines.ThisSellerShopLine.Email; txtPrice.Text = AllSellerShopLines.ThisSellerShopLine.Price.ToString(); txtQuantity.Text = AllSellerShopLines.ThisSellerShopLine.Quantity.ToString(); txtProductName.Text = AllSellerShopLines.ThisSellerShopLine.ProductName.ToString(); txtDescription.Text = AllSellerShopLines.ThisSellerShopLine.Description; }
protected void btnUpdate_Click(object sender, EventArgs e) { clsSellerShopLineCollection AllSellerShopLines = new clsSellerShopLineCollection(); //AllCustomers.ThisCustomer.CustomerId = CustomerId; string Error = AllSellerShopLines.ThisSellerShopLine.Valid(txtEmail.Text, Convert.ToString(DDListProductName.SelectedValue), txtNewPrice.Text, txtQuantity.Text, txtDescription.Text); if (Error == "") { Update(); lblError.Text = "Your Product details have been updated succeessfully. You can now go back to your Shop"; } else { lblError.Text = "Fix these issues : " + Error; } }
private void btnOK_Click(object sender, EventArgs e) { clsSellerShopLineCollection AllSellerShopLines = new clsSellerShopLineCollection(); String Error = AllSellerShopLines.ThisSellerShopLine.Valid(txtEmail.Text, txtProductName.Text, txtPrice.Text, txtQuantity.Text, txtDescription.Text); string message = "Are you sure to Add the new Seller Product to the Database?"; string caption = "User Confirmation!"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; //Displays the MessageBox //if there are no Errors returned if (Error == "") { //show the Message box result = MessageBox.Show(message, caption, buttons); //if "Yes" is pressed if (result == DialogResult.Yes) { //execute the Update method Add(); //All Done so Redirect to the previous Form SellerProductsManageForm SPM = new SellerProductsManageForm(); this.Hide(); SPM.ShowDialog(); this.Close(); } } else { //report an error lblError.Text = "There were problems with the data entered : " + Error; } }