protected void Button1_Click(object sender, EventArgs e) { ClientBussines clientBusines = new ClientBussines(); Domain.Client client = new Domain.Client(tbUserClient.Text, tbPassClient.Text, tbNameClient.Text, tbBorn.Text); clientBusines.insertClient(client); Response.Redirect("~/ Clients / ViewClient.aspx"); }
}//initSession public IHttpActionResult insert([FromBody] Client client) { ClientBussines busi = new ClientBussines(); busi.insertClient(client); String json = JsonConvert.SerializeObject(client); return(Json(new { Id = client.Id, Name = client.Name, Email = client.Email, Birthday = client.Birthday, Password = client.Password })); }//insert
public int insertClient(string email, string password, string name, string birthday) { var client = new Client() { Email = email, Password = password, Name = name, Birthday = birthday }; ClientBussines cliBusi = new ClientBussines(); cliBusi.insertClient(client); return(1); }//insert