protected void btnUpdate_ServerClick(object sender, EventArgs e) { try { var ml = new Sparepart_ML() { sparepartId = Convert.ToInt32(gridSpareparts.GetSelectedFieldValues("sparepartId")[0].ToString()), sparepartModel = txtName.Text, sparepartCategory = Convert.ToInt32(ddlCatogaries.SelectedValue), spareManufacturer = Convert.ToInt32(ddlManufacturers.SelectedValue), spareManufacYear = txtYear.Text, spareUnitCost = Convert.ToSingle(txtUnitCost.Text) }; var result = new Sparepart_BL().UpdateSparepart(ml); if (result) { GetSpareparts(); } } catch (Exception) { throw; } }
public string GetSpareparts(string manufacturer, string catergory) { var result = new BusinessLayer.Sparepart_BL().GetSpareparts( new ModelLayer.Spareparts.Sparepart_ML() { spareManufacturerName = manufacturer, sparepartCategoryName = catergory, sparepartModel = "", spareManufacYear = "" }); return JsonConvert.SerializeObject(result, Formatting.Indented); }