Exemple #1
0
        public List <Document> GetDocumentList()
        {
            DataBase dataBase = new DataBase();

            dataBase.AddParameter("p_pidm",
                                  GlobalVariables.getPdim(matricula),
                                  OracleDbType.Int64, 22);
            dataBase.AddParameter("p_aidy_code",
                                  aidyCode,
                                  OracleDbType.Varchar2, 16);
            dataBase.AddParameter("p_aidp_code",
                                  aidpCode,
                                  OracleDbType.Varchar2, 32);
            dataBase.AddParameter("p_fndc_code",
                                  fndcCode, OracleDbType.Varchar2, 40);

            dataBase.AddOutParameter("p_obdocs_all",
                                     OracleDbType.RefCursor, 20);
            DataTable pObdocsAll = dataBase.ExecuteFunction("SZ_BFQ_CARGADOCSSAF.f_obdocs_ps",
                                                            "salida", OracleDbType.Varchar2, 200).Tables["p_obdocs_all"];


            foreach (DataRow row in pObdocsAll.Rows)
            {
                Document temp = new Document()
                {
                    clave   = row["REQUISITO"].ToString(),
                    status  = row["STATUS"].ToString(),
                    name    = row["DESCRIPCION"].ToString(),
                    fecha   = row["ACTIVITY_DATE"].ToString(),
                    comment = row["COMMENTS"].ToString()
                };
                if (row["ACTIVITY_DATE"] == System.DBNull.Value)
                {
                    temp.fecha = new DateTime(1900, 1, 1)
                                 .ToString("dd-MMM-yyyy").Replace(".", "").ToUpper();
                }
                else
                {
                    temp.fecha = Convert.ToDateTime(row["ACTIVITY_DATE"].ToString())
                                 .ToString("dd-MMM-yyyy").Replace(".", "").ToUpper();
                }
                this.documents.Add(temp);
            }
            return(this.documents);
        }
Exemple #2
0
        public Kzrldoc(string matricula, string aidyCode, string aidpCode, string fndcCode, string treqCode)
        {
            DataBase dataBase = new DataBase();

            //In parameters
            dataBase.AddParameter("p_pidm",
                                  GlobalVariables.getPdim(matricula),
                                  OracleDbType.Int64, 22);
            dataBase.AddParameter("p_aidy_code",
                                  aidyCode,
                                  OracleDbType.Varchar2, 16);
            dataBase.AddParameter("p_aidp_code",
                                  aidpCode,
                                  OracleDbType.Varchar2, 32);
            dataBase.AddParameter("p_fndc_code",
                                  fndcCode, OracleDbType.Varchar2, 40);
            dataBase.AddParameter("p_treq_code",
                                  treqCode,
                                  OracleDbType.Varchar2, 32);

            //Out parameters
            dataBase.AddOutParameter("p_kzrldoc_tb",
                                     OracleDbType.RefCursor, 20);

            //Call of the function
            DataTable p_kzrldoc_tb = dataBase.ExecuteFunction("SZ_BFQ_CARGADOCSSAF.f_kzrldoc_tb",
                                                              "salida",
                                                              OracleDbType.Varchar2, 200).Tables["p_kzrldoc_tb"];
            DataRow row = p_kzrldoc_tb.Rows[0];


            this.TreqCode  = row["KZRLDOC_TREQ_CODE"].ToString();
            this.AidpCode  = row["KZRLDOC_AIDP_CODE"].ToString();
            this.AidyCode  = row["KZRLDOC_AIDY_CODE"].ToString();
            this.Comment   = row["KZRLDOC_COMMENT"].ToString();
            this.FileName  = row["KZRLDOC_FILE_NAME"].ToString();
            this.FileType  = row["KZRLDOC_FILE_TYPE"].ToString();
            this.FndcCode  = row["KZRLDOC_FNDC_CODE"].ToString();
            this.Id        = Convert.ToInt32(row["KZRLDOC_ID"].ToString());
            this.Matricula = GlobalVariables.Matricula;
            this.TrstCode  = row["KZRLDOC_TRST_CODE"].ToString();
            this.TrstDate  = Convert.ToDateTime(row["KZRLDOC_TRST_DATE"].ToString());
        }
Exemple #3
0
        public Document(string matricula, string clave, string fndcCode, string aidyCode, string aidpCode)
        {
            DataBase dataBase = new DataBase();

            //In parameters
            dataBase.AddParameter("p_pidm",
                                  GlobalVariables.getPdim(matricula),
                                  OracleDbType.Int64, 22);
            dataBase.AddParameter("p_aidy_code",
                                  aidyCode,
                                  OracleDbType.Varchar2, 16);
            dataBase.AddParameter("p_aidp_code",
                                  aidpCode,
                                  OracleDbType.Varchar2, 32);
            dataBase.AddParameter("p_fndc_code",
                                  fndcCode, OracleDbType.Varchar2, 40);
            dataBase.AddParameter("p_treq_code",
                                  clave,
                                  OracleDbType.Varchar2, 32);

            //Out parameters
            dataBase.AddOutParameter("p_obdocs_one",
                                     OracleDbType.RefCursor, 20);

            //Call of the function
            DataTable p_obdocs_one = dataBase.ExecuteFunction("SZ_BFQ_CARGADOCSSAF.f_obdocs_one",
                                                              "salida",
                                                              OracleDbType.Varchar2, 200).Tables["p_obdocs_one"];

            if (p_obdocs_one.Rows.Count == 0)
            {
                throw new HttpException(
                          (int)(HttpStatusCode.InternalServerError),
                          "Incapaz de recuperar su documento");
            }
            if (p_obdocs_one.Rows.Count > 1)
            {
                throw new HttpException(
                          (int)(HttpStatusCode.InternalServerError)
                          , "To many Rows");
            }

            DataRow row = p_obdocs_one.Rows[0];

            this.clave    = row["KVRTRFN_TREQ_CODE"].ToString();
            this.status   = row["STATUS"].ToString();
            this.name     = row["KVVTREQ_DESC"].ToString();
            this.fecha    = row["ACTIVITY_DATE"].ToString();
            this.comment  = row["COMMENTS"].ToString();
            this.aidpCode = row["KVRTRFN_AIDP_CODE"].ToString();
            this.aidyCode = row["KVRTRFN_AIDY_CODE"].ToString();
            this.fndcCode = row["KVRTRFN_FNDC_CODE"].ToString();
            if (row["ACTIVITY_DATE"] == System.DBNull.Value)
            {
                this.fecha = new DateTime(1900, 1, 1)
                             .ToString("dd-MMM-yyyy").Replace(".", "").ToUpper();
            }
            else
            {
                this.fecha = Convert.ToDateTime(row["ACTIVITY_DATE"].ToString())
                             .ToString("dd-MMM-yyyy").Replace(".", "").ToUpper();
            }
        }