public void Update() { //create an instance of the Inventory Collection clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); //validate the data on the Windows Form string Error = AllSellerShops.ThisSellerShop.Valid(txtNewShopName.Text, txtNewSellerName.Text, txtEmail.Text, txtRating.Text); //if the data is OK then add it to the object if (Error == "") { //find the record to UPDATE AllSellerShops.ThisSellerShop.Find(mShopId); //get the data entered by the user AllSellerShops.ThisSellerShop.ShopName = Convert.ToString(txtNewShopName); AllSellerShops.ThisSellerShop.SellerName = txtNewSellerName.Text; AllSellerShops.ThisSellerShop.Email = txtEmail.Text; AllSellerShops.ThisSellerShop.Rating = Convert.ToInt32(txtRating.Text); AllSellerShops.ThisSellerShop.DateOpened = Convert.ToDateTime(txtDateOpened.Text); //UPDATE the record AllSellerShops.Update(); //All Done so Redirect to the previous Form } else { lblError.Text = "There were problems with the data entered: " + Error; } }
public void Update() { //create an instance of the Seller Shop Collection clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); //validate the data on the Windows Form string Error = AllSellerShops.ThisSellerShop.Valid(txtShopName.Text, txtSellerName.Text, txtEmail.Text, Convert.ToString(comboBoxRating.SelectedItem)); //if the data is OK then add it to the object if (Error == "") { //find the record to UPDATE AllSellerShops.ThisSellerShop.Find(mShopId); //get the data entered by the user AllSellerShops.ThisSellerShop.ShopName = txtShopName.Text; AllSellerShops.ThisSellerShop.SellerName = txtSellerName.Text; AllSellerShops.ThisSellerShop.Email = txtEmail.Text; AllSellerShops.ThisSellerShop.Rating = Convert.ToInt32(comboBoxRating.SelectedItem); AllSellerShops.ThisSellerShop.DateOpened = Convert.ToDateTime(txtDateOpened.Text); //UPDATE the record AllSellerShops.Update(); //all done so redirect back to the main page SellerShopManageForm SSM = new SellerShopManageForm(); this.Hide(); SSM.ShowDialog(); this.Close(); } else { lblError.Text = "There were problems with the data entered: " + Error; } }
void Add() { //create an instance of the Payment Collenction clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); //validate the data on the web form string Error = AllSellerShops.ThisSellerShop.Valid(txtShopName.Text, txtSellerName.Text, txtEmail.Text, Convert.ToString(DDListProductName0.SelectedValue)); //if the data is OK then add it to the object if (Error == "") { //get the data entered by the user AllSellerShops.ThisSellerShop.Email = Convert.ToString(txtEmail.Text); AllSellerShops.ThisSellerShop.ShopName = Convert.ToString(txtShopName.Text); AllSellerShops.ThisSellerShop.SellerName = Convert.ToString(txtSellerName.Text); AllSellerShops.ThisSellerShop.Rating = Convert.ToInt32(DDListProductName0.SelectedValue); AllSellerShops.ThisSellerShop.DateOpened = Convert.ToDateTime(txtDateOpened.Text); //add the record AllSellerShops.Add(); } else { //report an error lblError.Text = "There were problems with the data entered : " + Error; } }
void DeleteSellerShopLine() { //function to delete the selected record //create an instance of the Inventory List clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); //find the record to delete AllSellerShops.ThisSellerShop.Find(mShopId); //delete the record AllSellerShops.Delete(); }
Int32 DisplaySellerShops(string EmailFilter) { clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); AllSellerShops.ReportByEmail(EmailFilter); //set the data source to the list of Inventories in the collection lstSellerShops.DataSource = AllSellerShops.SellerShopList; //set the name of the primary Key lstSellerShops.ValueMember = "ShopId"; //set the data field to display lstSellerShops.DisplayMember = "AllDetails"; return(AllSellerShops.Count); }
public void DisplaySellerShop() { //create an instance of the Seller Shop Collection clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); //find the record from the database to UPDATE AllSellerShops.ThisSellerShop.Find(mShopId); //Display the data for this record txtShopId.Text = AllSellerShops.ThisSellerShop.ShopId.ToString(); txtEmail.Text = AllSellerShops.ThisSellerShop.Email; txtShopName.Text = AllSellerShops.ThisSellerShop.ShopName.ToString(); txtSellerName.Text = AllSellerShops.ThisSellerShop.SellerName.ToString(); txtDateOpened.Text = AllSellerShops.ThisSellerShop.DateOpened.ToString(); comboBoxRating.Text = AllSellerShops.ThisSellerShop.Rating.ToString(); }
protected void btnUpdate_Click(object sender, EventArgs e) { clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); //AllCustomers.ThisCustomer.CustomerId = CustomerId; string Error = AllSellerShops.ThisSellerShop.Valid(txtNewShopName.Text, txtNewSellerName.Text, txtEmail.Text, txtRating.Text); if (Error == "") { Update(); lblError.Text = "Your Shop 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) { clsSellerShopCollection AllSellerShops = new clsSellerShopCollection(); string Error = AllSellerShops.ThisSellerShop.Valid(txtShopName.Text, txtSellerName.Text, txtEmail.Text, Convert.ToString(comboBoxRating.SelectedItem)); string message = "Are you sure to Update the existing Seller Shop Details?"; 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 Update(); //all done so redirect back to the main page SellerShopManageForm SSM = new SellerShopManageForm(); this.Hide(); SSM.ShowDialog(); this.Close(); } } else { //report an error lblError.Text = "There were problems with the data entered : " + Error; } }