protected void callbackControlSalvar_Callback(object source, DevExpress.Web.ASPxCallback.CallbackEventArgs e) { string param = ""; if (e.Parameter != null) { param = e.Parameter.ToString(); } float totalGrid = 0; if (GRIDITENSINSERIDOS.GetTotalSummaryValue(GRIDITENSINSERIDOS.TotalSummary["VALOR", DevExpress.Data.SummaryItemType.Sum]) == null) { totalGrid = 0; } else { totalGrid = float.Parse(GRIDITENSINSERIDOS.GetTotalSummaryValue(GRIDITENSINSERIDOS.TotalSummary["VALOR", DevExpress.Data.SummaryItemType.Sum]).ToString()); } if (totalGrid != float.Parse(dxtxtValorDID.Value.ToString()) && totalGrid != 0) { e.Result = "ERROR:Valor dos Itens está diferente do valor do DID!!!"; } else { if (cbbUndOrcamentaria.Value == null) { e.Result = "ERROR:Informe a Unidade Orçamentária !!!"; } else { if (cbbCentroCusto.Value == null) { e.Result = "ERROR:Informe o Centro de Custo !!!"; } else { if (txtDataDID.Value == null) { e.Result = "ERROR:Informe a Data !!!"; } else { if (dxtxtValorDID.Value.ToString() == "0,00") { e.Result = "ERROR:Informe o Valor do DID!!!"; } else { if (txtFornecedorNome.Value == null) { e.Result = "ERROR:Informe o Fornecedor !!!"; } else { if (cbbModalidadeEmpenho.Value == null) { e.Result = "ERROR:Modalidade de Empenho não informada !!!"; } else { if (string.IsNullOrEmpty(ASPxMemo1.Text)) { e.Result = "ERROR:Informe a especificação do histórico !!!"; } else { if (txtDotacao.Value == null) { e.Result = "ERROR:Informe a Dotação !!!"; } else { if (totalGrid == 0 && !string.IsNullOrEmpty(txtContrato.Text) && hdfReconhecimentoDivida.Get("RECONHECIMENTO").ToString().Equals("false")) { e.Result = "ERROR:Informe os Itens do Contrato Indicado!!!"; } else { var centrocustoCtrl = new CentroDeCustoCtrl(); bool testeOCG = centrocustoCtrl.centroCustoTemOCG(Convert.ToInt16(cbbCentroCusto.Value)); if (ObjetivoComumDeGastoCtrl.VerificaValordeLicitacaobyCentroDeCusto(cbbCentroCusto.Value.ToString(), float.Parse(dxtxtValorDID.Text)) && string.IsNullOrEmpty(txtContrato.Text) && string.IsNullOrEmpty(param) && testeOCG) { e.Result = "ErroLicitacao"; } else { string op = ""; if (Request.QueryString["op"] != null) { op = Request.QueryString["op"].ToString(); } string teste = hdfDadosDotacao.Get("CONTROLASALDO").ToString(); if (hdfDadosDotacao.Get("CONTROLASALDO").ToString() == "1") { if (op.Equals("edt")) { var saldoDID = float.Parse(Session[SessionTotalDID].ToString()) + CarregaSaldoDID(); var valorDID = float.Parse(dxtxtValorDID.Text); if ((float)saldoDID < (float)valorDID) { e.Result = "ERROR:Valor Solicitado é maior do que o Saldo disponível !!!"; } else { e.Result = GravaDID(); } } else { if (float.Parse(txtSaldo.Text) < float.Parse(dxtxtValorDID.Text)) { e.Result = "ERROR:Valor Solicitado é maior do que o Saldo disponível !!!"; } else { e.Result = GravaDID(); } } } else { e.Result = GravaDID(); } } } } } } } } } } } } }