public ActionResult SubmitForm(PositionRequest request, string type) { if (type == "add") { var data = _position.Insert(request); return(Content(data.ToJson())); } else { var data = _position.Update(request); return(Content(data.ToJson())); } }
private void btnSave_Click(object sender, EventArgs e) { Position p = new Position(); p.Name = txtName.Text; p.Description = txtDescription.Text; p.TeamId = int.Parse(cboTeam.SelectedValue.ToString()); p.RoleId = int.Parse(cboRole.SelectedValue.ToString()); if (_positionToUpdate == null) { PositionLogic.Add(p); } else { PositionLogic.Update(_positionToUpdate, p); } Close(); }
private void Update() { _poclog.Update(ThePosition); CancelProperties(); RefreshCollection(); }