private void btnUpdate_Click(object sender, EventArgs e) { try { if (!CheckMandatoryFileds()) { return; } List <ProductModel> prdNcmpList = mngStock.GetProductDetails(); //bool flag = prdNcmpList.Exists(pc => pc.ProductName.ToLower().Replace(" ", "") == cmbProductName.Text.ToLower().Replace(" ", "") && pc.CompanyName.ToLower().Replace(" ", "") == cmbCompany.Text.ToLower().Replace(" ", "")); //if (!flag) //{ string weight = (txtWeight.Text.Replace(" ", "") + cmbUnit.Text).ToLower(); mngStock.UpdateStock(Stock.ID, (cmbProductName.SelectedItem as Product).ID, (cmbCompany.SelectedItem as Company).ID, weight, txtDetails.Text, txtMrp.Text.Trim(), txtRate.Text.Trim(), Convert.ToInt32(txtStock.Text), txtSgst.Text.Trim(), txtCgst.Text.Trim(), txtIgst.Text.Trim()); RefreshStockGrid(); // _gridStock.Rows[rowIndex].Selected = true; //} MessageBox.Show("This Item is successfully updated.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { Logger.WriteErrorMessage(ex); } }
public ActionResult <bool> UpdateStock(string code, int up) { return(eita.UpdateStock(code, up)); }