protected void btnUpdate_ServerClick(object sender, EventArgs e) { try { var ml = new TowTruckService_ML(gridTowTrucks.GetSelectedFieldValues("Id")[0].ToString(),txtName.Text,txtLocation.Value,txtTp.Value,txtEmail.Value); var result = new TowTruckService_BL().UpdateTowTruckService(ml); if (result) { GetTowTruckServices(); } } catch (Exception) { throw; } }
protected void btnSave_ServerClick(object sender, EventArgs e) { try { var ml = new TowTruckService_ML() { name = txtName.Text, tp = txtTp.Value, location = txtLocation.Value, email = txtEmail.Value }; var result = new TowTruckService_BL().AddTowTruckService(ml); if (result) { GetTowTruckServices(); } } catch (Exception) { throw; } }
public string GetTowTruckServiceInfo(string location) { var result = new TowTruckService_BL().GetTowTruckServices(new TowTruckService_ML() { location = location }); return JsonConvert.SerializeObject(result, Formatting.Indented); }