private void Save() { if(txtSum != null) { user.Notes = txtNotes.Value; rPay.Sum = decimal.Parse(txtSum.Value); rPay.UserId = user.id; rPay.Date = DateTime.Now; if (chkActive.Checked == true) { user.Active = 1; } else { user.Active = 0; } if (rPay.State() == DataRowState.Detached) rPay.Add(); try { //int i = 0; //decimal d = 100 / i; manager.Update(domain.Changes(), new string[] { "UserInfo" }); manager.Update(domain.Changes(), new string[] { "Payments" }); Response.Redirect("Payments.aspx", true); } catch (Exception ex) { Page.RegisterStartupScript("start", ""); } } }