protected void btnAssociationBanckAccount_Click(object sender, EventArgs e) { txtAssociationBanckAccount.Attributes.CssStyle.Add("border-color", ""); if (txtAssociationBanckAccount.Enabled) { if (string.IsNullOrEmpty(txtAssociationBanckAccount.Text)) { txtAssociationBanckAccount.Attributes.CssStyle.Add("border-color", "red"); } else { txtAssociationBanckAccount.Enabled = false; var es = AssociationsManager.GetById(Association.Id); es.BanckAccont = txtAssociationBanckAccount.Text; AssociationsManager.Update(es); Session[SessionConstants.SelectedAssociation] = es; var associations = AssociationsManager.GetAllAssociationsByPartner(Association.Id_Partner); Session[SessionConstants.AllAssociations] = associations; Response.Redirect(Request.RawUrl); } } else { txtAssociationBanckAccount.Enabled = true; } }
protected void associationEqualIndiviza_SelectedIndexChanged(object sender, EventArgs e) { var es = AssociationsManager.GetById(Association.Id); if (es.CotaIndivizaAparments.HasValue && drpAssociationEqualIndiviza.SelectedIndex == 0) { es.CotaIndivizaAparments = null; AssociationsManager.Update(es); Session[SessionConstants.SelectedAssociation] = es; } if (drpAssociationEqualIndiviza.SelectedIndex == 0) { txtAssociationCotaIndivizaApartments.Visible = false; btnAssociationEqualIndiviza.Visible = false; } else { txtAssociationCotaIndivizaApartments.Visible = true; btnAssociationEqualIndiviza.Visible = true; } }
protected void btnAssociationEqualIndiviza_Click(object sender, EventArgs e) { txtAssociationCotaIndivizaApartments.Attributes.CssStyle.Add("border-color", ""); if (txtAssociationCotaIndivizaApartments.Enabled) { if (string.IsNullOrEmpty(txtAssociationCotaIndivizaApartments.Text)) { txtAssociationCotaIndivizaApartments.Attributes.CssStyle.Add("border-color", "red"); } else { txtAssociationCotaIndivizaApartments.Enabled = false; var es = AssociationsManager.GetById(Association.Id); decimal?cotaIndivizaAparmentsResult; decimal cotaIndivizaAparments; if (decimal.TryParse(txtAssociationCotaIndivizaApartments.Text, out cotaIndivizaAparments)) { cotaIndivizaAparmentsResult = cotaIndivizaAparments; } else { cotaIndivizaAparmentsResult = null; } es.CotaIndivizaAparments = cotaIndivizaAparments; AssociationsManager.Update(es); Session[SessionConstants.SelectedAssociation] = es; var Associations = AssociationsManager.GetAllAssociationsByPartner(Association.Id_Partner); Session[SessionConstants.AllAssociations] = Associations; Response.Redirect(Request.RawUrl); } } else { txtAssociationCotaIndivizaApartments.Enabled = true; } }