예제 #1
0
        public string Add(RFCTLKEY datos)
        {
            string        res   = "";
            StringBuilder query = new StringBuilder();

            query.Append(" INSERT INTO RFCTLKEY(");
            query.Append(" KCATEG, KLLAVE)");
            query.Append(" VALUES (");
            query.AppendFormat(" '{0}', '{1}')", datos.KCATEG, datos.KLLAVE);

            try
            {
                db.Execute(query.ToString());
                res = "OK";
            }
            catch (iDB2SQLErrorException ex)
            {
                res = "ERROR: " + ex.ToString() + " " + query.ToString();
            }
            catch (iDB2Exception ex)
            {
                res = "ERROR: " + ex.ToString() + " " + query.ToString();
            }
            catch (Exception ex)
            {
                res = "ERROR: " + ex.ToString() + " " + query.ToString();
            }
            return(res);
        }
예제 #2
0
        private bool CtlProcesoUnico(string Categ, string Llave)
        {
            bool     continua  = true;
            string   res       = "";
            RFCTLKEY mRFCTLKEY = new RFCTLKEY()
            {
                KCATEG = Categ,
                KLLAVE = Llave
            };

            res = dRFCTLKEY.Add(mRFCTLKEY);
            if (res.Contains("ERROR"))
            {
                continua = false;
            }
            return(continua);
        }