Пример #1
0
        public int actualizarRegistro_Param(ref List <Ent_tticol125> parametros, ref string strError, string Aplicacion, bool updHist = false)
        {
            method = MethodBase.GetCurrentMethod();
            bool   retorno = false;
            string table   = owner + ".tticol125" + env;
            List <Ent_tticol080> Parametros080 = new List <Ent_tticol080>();
            Ent_tticol080        t080          = new Ent_tticol080();
            tticol080            dal080        = new tticol080();
            string strTagId = string.Empty;

            if (updHist)
            {
                table = owner + ".tticol126" + env;
            }

            try
            {
                strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, table);
                string strCondicion = string.Empty;

                foreach (Ent_tticol125 reg in parametros)
                {
                    strCondicion = " WHERE ROWID = '" + reg.idrecord + "'";
                    parametrosIn = AdicionaParametrosComunesUpdate(reg);
                    retorno      = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia + strCondicion, ref parametersOut, parametrosIn, false);

                    //Requerimiento No. 46122.
                    //Insertar en la tabla ticol080 - Comentado por nuevos requerimientos
                    //CChaverra 28/07/2017 - 09/03/2017
                    //if (Convert.ToInt32(retorno) > 0)
                    //{
                    //    t080 = new Ent_tticol080();
                    //    t080.orno = reg.pdno;
                    //    t080.pono = reg.pono;
                    //    t080.item = reg.item;
                    //    t080.cwar = reg.cwar;
                    //    t080.qune = reg.reqt * -1;
                    //    t080.logn = reg.user;
                    //    t080.proc = 2;
                    //    t080.refcntd = 0;
                    //    t080.refcntu = 0;
                    //    t080.clot = reg.clot;
                    //    Parametros080.Add(t080);
                    //    dal080.insertarRegistro(ref Parametros080, ref strError, ref strTagId);
                    //    Parametros080.Clear();

                    //    if (!string.IsNullOrEmpty(strError))
                    //        break;
                    //}
                }
                return(Convert.ToInt32(retorno));
            }

            catch (Exception ex)
            {
                strError += "Error updating data [125]. Try again or contact your administrator";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name);
            }
            return(Convert.ToInt32(retorno));
        }
Пример #2
0
        public int insertarRegistro(ref List <Ent_tticol125> parametros, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();
            bool retorno = false;

            foreach (var item in parametros)
            {
                if (item.paid == "")
                {
                    item.paid = " ";
                }
            }

            List <Ent_tticol080> Parametros080 = new List <Ent_tticol080>();
            Ent_tticol080        t080          = new Ent_tticol080();
            tticol080            dal080        = new tticol080();
            string strTagId = string.Empty;

            try
            {
                strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla);

                foreach (Ent_tticol125 reg in parametros)
                {
                    parametrosIn = AdicionaParametrosComunes(reg);
                    retorno      = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false);

                    //Requerimiento No. 46122.
                    //Se quitó la inserción en la tabla ticol080
                    //CChaverra 28/07/2017
                    //if (Convert.ToInt32(retorno) > 0)
                    //{
                    //    t080 = new Ent_tticol080();
                    //    t080.orno = reg.pdno;
                    //    t080.pono = reg.pono;
                    //    t080.item = reg.item;
                    //    t080.cwar = reg.cwar;
                    //    t080.qune = reg.reqt * -1;
                    //    t080.logn = reg.user;
                    //    t080.proc = 2;
                    //    t080.refcntd = 0;
                    //    t080.refcntu = 0;
                    //    t080.clot = reg.clot;
                    //    Parametros080.Add(t080);
                    //    dal080.insertarRegistro(ref Parametros080, ref strError, ref strTagId);
                    //    Parametros080.Clear();

                    //    if (!string.IsNullOrEmpty(strError))
                    //        break;
                    //}
                }
            }

            catch (Exception ex)
            {
                strError += "Error when inserting data [025]. Try again or contact your administrator";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, method.Module.Name, method.Name, method.ReflectedType.Name);
            }
            return(Convert.ToInt32(retorno));
        }