public Boolean ValidaDoubleCheck() { MMAA.Pedidos.Model.WorkFlowProcesso workflowProcessoAbertura = new MMAA.Pedidos.Model.WorkFlowProcesso(); workflowProcessoAbertura = (MMAA.Pedidos.Model.WorkFlowProcesso)Session["workflowProcessoAbertura"]; if (workflowProcesso.NrProcesso != workflowProcessoAbertura.NrProcesso) return false; if (workflowProcesso.CdEspecialidade != workflowProcessoAbertura.CdEspecialidade) return false; if (workflowProcesso.NrCnj != workflowProcessoAbertura.NrCnj) return false; if (workflowProcesso.CdComarca != workflowProcessoAbertura.CdComarca) return false; if (workflowProcesso.DataAutuacao != workflowProcessoAbertura.DataAutuacao) return false; if (workflowProcesso.DataDistribuicao != workflowProcessoAbertura.DataDistribuicao) return false; if (workflowProcesso.OutroCodigo != workflowProcessoAbertura.OutroCodigo) return false; if (workflowProcesso.CdEscritorio != workflowProcessoAbertura.CdEscritorio) return false; if (workflowProcesso.NmAutoInfracao != workflowProcessoAbertura.NmAutoInfracao) return false; if (workflowProcesso.NmCda != workflowProcessoAbertura.NmCda) return false; if (workflowProcesso.NmProcessoADM != workflowProcessoAbertura.NmProcessoADM) return false; if (workflowProcesso.ExecucaoFiscal != workflowProcessoAbertura.ExecucaoFiscal) return false; if (workflowProcesso.CdEsfera != workflowProcessoAbertura.CdEsfera) return false; if (workflowProcesso.CdTipoEspecialidade != workflowProcessoAbertura.CdTipoEspecialidade) return false; // Valida as partes DataTable dtWorkFlowProcessoParte = new DataTable(); DataTable dtWorkFlowProcessoParteDC = new DataTable(); dtWorkFlowProcessoParte = objParte.CarregaWorkflowParte(idWorkflow, 0); dtWorkFlowProcessoParteDC = objParte.CarregaWorkflowParteDC(idWorkflow, 0); try { for (int i = 0; i < 2; i++) { if (dtWorkFlowProcessoParte.Select("cd_parte = " + dtWorkFlowProcessoParteDC.Rows[i]["cd_parte"].ToString() + "").Rank == 0 && dtWorkFlowProcessoParte.Select("sg_tipoParte = " + dtWorkFlowProcessoParteDC.Rows[i]["sg_tipoParte"].ToString() + "").Rank == 0) return false; } } catch { return false; } return true; }
public List<Model.WorkFlowProcesso> WorkFlowProcesso_List(int id_workflow, int workFlow_processo) { try { DB data = new DB(); DataTable dt = new DataTable(); data.AddParametro("@ID_WORKFLOW", id_workflow); data.AddParametro("@ID_ABERTURA_WORKFLOW_PROCESSO", workFlow_processo); dt = data.ExecuteReader("ABERTURA_WORKFLOW_PROCESSO_SELECIONA"); List<Model.WorkFlowProcesso> lstWorkflow = new List<MMAA.Pedidos.Model.WorkFlowProcesso>(); if (dt != null && dt.Rows.Count > 0) { Model.WorkFlowProcesso workflow = new MMAA.Pedidos.Model.WorkFlowProcesso(); foreach (DataRow dr in dt.Rows) { workflow.IdWorkflow = dr["ID_WORKFLOW"].ToString().Equals("0") ? 0 : int.Parse(dr["ID_WORKFLOW"].ToString()); workflow.IdWorkflowProcesso = dr["ID_ABERTURA_WORKFLOW_PROCESSO"].ToString().Equals("0") ? 0 : int.Parse(dr["ID_ABERTURA_WORKFLOW_PROCESSO"].ToString()); workflow.NrProcesso = dr["NR_PROCESSO"].ToString(); workflow.CdAcao = dr["CD_ACAO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_ACAO"].ToString()); workflow.CdTipoProcessoEletronico = dr["CD_TIPOPROCESSOELETRONICO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_TIPOPROCESSOELETRONICO"].ToString()); workflow.ProcessoMigrado = dr["PROCESSO_MIGRADO"].ToString(); workflow.CdComarca = dr["CD_COMARCA"].ToString().Equals("") ? 0 : int.Parse(dr["CD_COMARCA"].ToString()); workflow.CdForum = dr["CD_FORUM"].ToString().Equals("") ? 0 : int.Parse(dr["CD_FORUM"].ToString()); workflow.CdVara = dr["CD_VARA"].ToString().Equals("") ? 0 : int.Parse(dr["CD_VARA"].ToString()); workflow.CdRito = dr["CD_RITO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_RITO"].ToString()); workflow.CdProcedimento = dr["CD_PROCEDIMENTO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_PROCEDIMENTO"].ToString()); workflow.CdAmbito = dr["CD_AMBITO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_AMBITO"].ToString()); workflow.CdOrgao = dr["CD_ORGAO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_ORGAO"].ToString()); workflow.DataAutuacao = dr["DATA_AUTUACAO"].ToString().Equals("") ? DateTime.Parse("01/01/1900") : DateTime.Parse(dr["DATA_AUTUACAO"].ToString()); workflow.DataDistribuicao = dr["DATA_DISTRIBUICAO"].ToString().Equals("") ? DateTime.Parse("01/01/1900") : DateTime.Parse(dr["DATA_DISTRIBUICAO"].ToString()); workflow.CdFaseProcesso = dr["CD_FASEPROCESSO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_FASEPROCESSO"].ToString()); workflow.CdRisco = dr["CD_RISCO"].ToString().Equals("") ? 0 : int.Parse(dr["CD_RISCO"].ToString()); workflow.ValorEnvolvido = dr["VALOR_ENVOLVIDO"].ToString().Equals("") ? 0 : float.Parse(dr["VALOR_ENVOLVIDO"].ToString()); workflow.ValorCausa = dr["VALOR_CAUSA"].ToString().Equals("") ? 0 : float.Parse(dr["VALOR_CAUSA"].ToString()); lstWorkflow.Add(workflow); workflow = new MMAA.Pedidos.Model.WorkFlowProcesso(); } } return lstWorkflow; } catch (Exception ex) { // Log.Save(ex.Message.ToString()); return null; } }