public int DML(productMaster pm) { int result = 0; try { DBParameterCollection paramCollection = new DBParameterCollection(); paramCollection.Add(new DBParameter("@Id", pm.ProductMasterId)); paramCollection.Add(new DBParameter("@name", pm.Name)); paramCollection.Add(new DBParameter("@Status", pm.IsActive)); paramCollection.Add(new DBParameter("@Flag", pm.Flag)); result = _DBHelper.ExecuteNonQuery("SpShiftDML", paramCollection, CommandType.StoredProcedure); } catch (Exception ex) { return(-999); } return(result); }
protected void btnAdd_Click(object sender, EventArgs e) { productMaster pm = new productMaster(); DbProductMaster db = new DbProductMaster(); pm.Name = txtProduct.Text; if (dpStatus.SelectedItem.Value == "1") { pm.IsActive = true; } else { pm.IsActive = false; } int result = db.DML(pm); if (result > 0) { } }