Пример #1
0
        //my nuevo metodo
        public bool insertarRegistroAux(Ent_tticol022 Objtticol022, Ent_tticol020 Objtticol020)
        {
            method = MethodBase.GetCurrentMethod();
            bool retorno = false;

            paramList = new Dictionary <string, object>();

            paramList.Add(":T$PDNO", Objtticol022.pdno.Trim().ToUpper().ToString());
            paramList.Add(":T$SQNB", Objtticol022.sqnb.ToUpper().ToString());
            paramList.Add(":T$PROC", Objtticol022.proc.ToString());
            paramList.Add(":T$LOGN", Objtticol022.logn.ToString());
            paramList.Add(":T$MITM", Objtticol022.mitm.ToString());
            paramList.Add(":T$QTDL", Objtticol022.qtdl.ToString());
            paramList.Add(":T$CUNI", Objtticol022.cuni.ToUpper().ToString());
            paramList.Add(":T$LOG1", Objtticol022.log1.ToUpper().ToString());
            paramList.Add(":T$QTD1", Objtticol022.qtd1.ToString());
            paramList.Add(":T$PRO1", Objtticol022.pro1.ToString());
            paramList.Add(":T$LOG2", Objtticol022.log2.ToUpper().ToString());
            paramList.Add(":T$QTD2", Objtticol022.qtd2.ToString());
            paramList.Add(":T$PRO2", Objtticol022.pro2.ToString());
            paramList.Add(":T$LOCA", Objtticol022.loca.ToUpper().ToString());
            paramList.Add(":T$NORP", Objtticol022.norp.ToString());
            paramList.Add(":T$DELE", Objtticol022.dele.ToString());
            paramList.Add(":T$LOGD", Objtticol022.logd.ToUpper().ToString());
            paramList.Add(":T$REFCNTD", "0");
            paramList.Add(":T$REFCNTU", "0");

            try
            {
                string strError = string.Empty;
                strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList);
                retorno      = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false);
                if (retorno)
                {
                    DAL.tticol020 dal020     = new tticol020();
                    bool          intRetorno = dal020.insertarRegistroAux(Objtticol020);
                    Ent_tticol022 nreg       = Objtticol022;
                    int           retorno222 = InsertarRegistroTicol222(ref nreg, ref strError);
                }
                return(retorno);
            }
            catch (Exception ex)
            {
                string strError = "Error when inserting data [col022]. Try again or contact your administrator";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(retorno);
        }
Пример #2
0
        public int insertarRegistro(ref List <Ent_tticol022> parametros, ref List <Ent_tticol020> parametros020, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();
            bool retorno = false;

            try
            {
                strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla);
                log.escribirError(strSentencia, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
                foreach (Ent_tticol022 reg in parametros)
                {
                    if (!invLabel_tiempoGrabacion(reg, ref strError))
                    {
                        break;
                    }

                    // Inicia la insercion del registro
                    parametrosIn = AdicionaParametrosComunes(reg);
                    retorno      = DAL.BaseDAL.BaseDal.EjecutarCrud("text", strSentencia, ref parametersOut, parametrosIn, false);
                    if (retorno)
                    {
                        DAL.tticol020 dal020     = new tticol020();
                        int           intRetorno = dal020.insertarRegistro(ref parametros020, ref strError);
                        Ent_tticol022 nreg       = reg;
                        int           retorno222 = InsertarRegistroTicol222(ref nreg, ref strError);
                    }
                }
                return(Convert.ToInt32(retorno));
            }
            catch (Exception ex)
            {
                strError = "Error when inserting data [col022]. Try again or contact your administrator";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(Convert.ToInt32(retorno));
        }