private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0 | e.ColumnIndex == 1) { productEL.Productid = Convert.ToInt32(dgv.SelectedRows[0].Cells["PRODUCT ID"].Value); } if (e.ColumnIndex == 0) { s = "EDIT"; lblTitle.Text = "UPDATE CATEGORY"; ShowForm(true); productEL = productBL.Select(productEL); categoryEL.Categoryid = productEL.Categoryid; categoryEL = categoryBL.Select(categoryEL); txtProductName.Text = productEL.Productname; cbCategory.SelectedIndex = cbCategory.FindString(categoryEL.Category); txtDescription.Text = productEL.Description; txtPrice.Text = productEL.Price.ToString(); txtStocks.Text = productEL.Stocks.ToString(); } else if (e.ColumnIndex == 1) { DialogResult dialogResult = MessageBox.Show("ARE YOU SURE TO DELETE THIS SELECTED ITEM?", "DELETING", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { ShowResult(productBL.Delete(productEL)); } } }
private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0 | e.ColumnIndex == 1) { categoryEL.Categoryid = Convert.ToInt32(dgv.SelectedRows[0].Cells["CATEGORY ID"].Value); } if (e.ColumnIndex == 0) { s = "EDIT"; lblTitle.Text = "UPDATE CATEGORY"; ShowForm(true); categoryEL = categoryBL.Select(categoryEL); txtCategory.Text = categoryEL.Category; } else if (e.ColumnIndex == 1) { DialogResult dialogResult = MessageBox.Show("ARE YOU SURE TO DELETE THIS SELECTED ITEM?", "DELETING", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { ShowResult(categoryBL.Delete(categoryEL)); } } }
public EL.Registrations.categories Select(EL.Registrations.categories categoryEL) { var dt = Helper.executeQuery("select * from categories where categoryid = '" + categoryEL.Categoryid + "'"); if (dt.Rows.Count > 0) { categoryEL.Categoryid = Convert.ToInt32(dt.Rows[0]["categoryid"].ToString()); categoryEL.Category = dt.Rows[0]["category"].ToString(); return(categoryEL); } else { return(null); } }
public bool Delete(EL.Registrations.categories categoryEL) { return(categoryDL.Delete(categoryEL)); }
public bool Update(EL.Registrations.categories categoryEL) { return(categoryDL.Update(categoryEL)); }
public long Insert(EL.Registrations.categories categoryEL) { return(categoryDL.Insert(categoryEL)); }
public EL.Registrations.categories Select(EL.Registrations.categories categoryEL) { return(categoryDL.Select(categoryEL)); }
public bool Delete(EL.Registrations.categories categoryEL) { return(Helper.executeNonQueryBool("delete from categories where categoryid = '" + categoryEL.Categoryid + "'")); }
public bool Update(EL.Registrations.categories categoryEL) { categoryEL.Category = MySql.Data.MySqlClient.MySqlHelper.EscapeString(categoryEL.Category); return(Helper.executeNonQueryBool("update categories set category = '" + categoryEL.Category + "' where categoryid = '" + categoryEL.Categoryid + "'")); }
public long Insert(EL.Registrations.categories categoryEL) { categoryEL.Category = MySql.Data.MySqlClient.MySqlHelper.EscapeString(categoryEL.Category); return(Helper.executeNonQueryLong("insert into categories (category) values ('" + categoryEL.Category + "')")); }