Esempio n. 1
0
        public OutJustification GetJustification(int flowType)
        {
            var response = new OutJustification();

            try
            {
                PqrDAO dao = new PqrDAO();
                response = dao.GetJustification(flowType);
            }
            catch (Exception ex)
            {
                //escribir en el log
                LogHelper.WriteLog("Models", "ManagerPQR", "GetJustification", ex, "");
            }
            return(response);
        }
Esempio n. 2
0
        public OutJustification GetJustification(int flowType)
        {
            string           connectionString = DataBaseHelper.GetConnectionString("DLG");
            OutJustification response         = new OutJustification();
            var ora = new OracleServer(connectionString);

            Justification        justification;
            List <Justification> list = new List <Justification>();
            string command            = string.Empty;

            try
            {
                command = "SELECT BBS_WFG_TIPO_JUSTIFICA.TIPO_REQUISITO, BBS_WFG_TIPO_JUSTIFICA.NOMBRE_REQUISITO FROM BBS_WFG_TIPO_JUSTIFICA ";
                command = command + string.Format(" WHERE BBS_WFG_TIPO_JUSTIFICA.TIPO_FLUJO = {0} ", flowType);
                var rdr = ora.ExecuteCommand(command);

                while (rdr.Read())
                {
                    justification = new Justification();
                    justification.justificationType = DBNull.Value.Equals(rdr["TIPO_REQUISITO"]) ? 0 : int.Parse(rdr["TIPO_REQUISITO"].ToString());
                    justification.justificationName = DBNull.Value.Equals(rdr["NOMBRE_REQUISITO"]) ? string.Empty : rdr["NOMBRE_REQUISITO"].ToString();
                    list.Add(justification);
                }
                rdr.Close();
                response.lstJustification = list;
                response.msg              = new Response();
                response.msg.errorCode    = "200";
                response.msg.errorMessage = "OK";
            }
            catch (Exception ex)
            {
                throw new Exception("PqrDAO.GetJustification", ex);
            }
            finally
            {
                ora.Dispose();
            }
            return(response);
        }