private void tb_pay_ContragentCode_TextChanged(object sender, EventArgs e) { DataSaver ds = new DataSaver(login_, password_); tb_pay_ContragentType.Text = ds.GetContragentType(tb_pay_ContragentCode.Text); if (tb_pay_ContragentType.Text.Substring(0,26) != "Контрагента не существует!") { tp_pay_ContractCode.Enabled = true; cb_pay_FinPosition.Enabled = true; gb_pay2.Enabled = true; link_payment_add.Enabled = true; link_payment_del.Enabled = true; link_payment_update.Enabled = true; tb_pay_EPL.Enabled = true; tb_pay_PFMcode.Enabled = true; tb_pay_SummRUB.Enabled = true; if(inform_[2] != "1") button7.Enabled = true; tb_plan_statelikvid.Enabled = true; tb_plan_stavrolen.Enabled = true; tb_pay_ContragentType.ForeColor = System.Drawing.Color.Black; } else { tp_pay_ContractCode.Enabled = false; cb_pay_FinPosition.Enabled = false; gb_pay2.Enabled = false; link_payment_add.Enabled = false; link_payment_del.Enabled = false; link_payment_update.Enabled = false; button7.Enabled = false; tb_pay_EPL.Enabled = false; tb_pay_PFMcode.Enabled = false; tb_pay_SummRUB.Enabled = false; tb_plan_statelikvid.Enabled = false; tb_plan_stavrolen.Enabled = false; tb_pay_ContragentType.ForeColor = System.Drawing.Color.Red; } }