Пример #1
0
        public DataTable spareDelivery_verificaOrdenes_Param(ref Ent_ttscol100 Parametros, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();

            /* Estados
             * 1: Libre
             * 5. Libre
             * 10. PLaneada
             * 15. Liberada o release
             * 20. COmpleta o Completed
             * 23. Costos o Costed
             * 25. Cerrada o Closed
             * 35. Cancelada o Canceled
             */

            paramList = new Dictionary <string, object>();
            paramList.Add("p1", Parametros.orno.Trim().ToUpperInvariant());
            strSentencia = recursos.readStatement("ttssoc200", method.Name, ref owner, ref env, tabla, paramList);

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Service order doesn't exist or status doesn't allowed. Cannot Continue.";
                }
            }
            catch (Exception ex)
            {
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }
Пример #2
0
 public DataTable spareDelivery_verificaOrdenes_Param(ref Ent_ttscol100 Parametros, ref string strError)
 {
     //int retorno = -1;
     DataTable retorno;
     try
     {
         retorno = dal.spareDelivery_verificaOrdenes_Param(ref Parametros, ref strError);
         return retorno;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.InnerException.ToString());
     }
 }
Пример #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (ViewState["tablaTemp"] != null)
            {
                DataTable tablaTemp = ViewState["tablaTemp"] as DataTable;

                if (tablaTemp.Rows.Count >= 1)
                {
                    List <Ent_ttscol100> parameterCollection = new List <Ent_ttscol100>();

                    for (int i = 1; i <= tablaTemp.Rows.Count; i++)
                    {
                        obj      = new Ent_ttscol100();
                        obj.orno = txtWorkOrder.Text.Trim().ToUpperInvariant();
                        obj.item = tablaTemp.Rows[i - 1]["T$ITEM"].ToString();
                        obj.loca = tablaTemp.Rows[i - 1]["T$LOCA"].ToString();
                        obj.cwar = tablaTemp.Rows[i - 1]["T$CWAR"].ToString();
                        string toreturn = tablaTemp.Rows[i - 1]["T$QDEL"].ToString();
                        obj.qdel    = Decimal.Parse(toreturn, System.Globalization.CultureInfo.InvariantCulture);
                        obj.logn    = Session["user"].ToString();
                        obj.mess    = " ";
                        obj.refcntd = 0;
                        obj.refcntu = 0;
                        obj.cusr    = "******";
                        obj.conf    = 2;
                        parameterCollection.Add(obj);
                    }

                    idal.insertarRegistro(ref parameterCollection, ref strError);
                    printResult.Visible = true;

                    if (strError != string.Empty)
                    {
                        lblResult.Text = strError;
                        throw new System.InvalidOperationException(strError);
                    }

                    lblResult.Text = SpareDeliverywassuccesfullyregistered;

                    createObjectTable();
                    btnAddRow.Enabled = true;
                }
            }
            else
            {
                lblResult.Text = ViewStateisnullPleasecontacttosupport
                ;
            }
        }
Пример #4
0
        private List <Ent_ParametrosDAL> AdicionaParametrosComunes(Ent_ttscol100 parametros, bool blnUsarPRetorno = false)
        {
            method = MethodBase.GetCurrentMethod();
            string strError = string.Empty;
            List <Ent_ParametrosDAL> parameterCollection = new List <Ent_ParametrosDAL>();

            try
            {
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ORNO", DbType.String, parametros.orno.ToUpperInvariant());
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$ITEM", DbType.String, parametros.item.Trim().ToUpperInvariant());
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOCA", DbType.String, parametros.loca);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CWAR", DbType.String, parametros.cwar.ToUpperInvariant());
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$QDEL", DbType.Decimal, Convert.ToDecimal(parametros.qdel).ToString("#.##0,0000"));
//                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CDAT", DbType.String, parametros.cdat);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$MESS", DbType.String, parametros.mess);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTD", DbType.Int32, parametros.refcntd);
                Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$REFCNTU", DbType.Int32, parametros.refcntu);


                if (!string.IsNullOrEmpty(parametros.logn))
                {
                    Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$LOGN", DbType.String, parametros.logn);
                }
                if (!string.IsNullOrEmpty(parametros.cusr))
                {
                    Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CUSR", DbType.String, parametros.cusr);
                }
                if (parametros.conf > 0)
                {
                    Ent_ParametrosDAL.AgregaParametro(ref parameterCollection, ":T$CONF", DbType.Int32, parametros.conf);
                }


                if (blnUsarPRetorno)
                {
                    Ent_ParametrosDAL pDal = new Ent_ParametrosDAL();
                    pDal.Name         = "@p_Int_Resultado";
                    pDal.Type         = DbType.Int32;
                    pDal.ParDirection = ParameterDirection.Output;
                    parameterCollection.Add(pDal);
                }
            }
            catch (Exception ex)
            {
                strError = "Error when creating parameters [scol100]. Try again or contact your administrator \n";
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(parameterCollection);
        }
Пример #5
0
        public static string validaInfo(string valor, string tipo, string orden = null)
        {
            string    strSecondVal = string.Empty;
            string    strError     = string.Empty;
            string    retorno      = string.Empty;
            DataTable resultado    = new DataTable();

            InterfazDAL_ttwhcol016 idal016 = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj016  = new Ent_ttwhcol016();

            InterfazDAL_ttscol100 idal = new InterfazDAL_ttscol100();
            Ent_ttscol100         obj  = new Ent_ttscol100();

            if (tipo == "1") // Items
            {
                obj.item  = valor;
                resultado = idal.spareDelivery_listaRegistroItem_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    retorno = resultado.Rows[0]["DESCRIPCION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["UNIDAD"].ToString().Trim() + "|" +
                              resultado.Rows[0]["ARTICULO"].ToString().Trim();
                }
            }

            if (tipo == "2") // Lote
            {
                obj.loca  = valor;
                resultado = idal.spareDelivery_listaRegistroUbicacion_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    retorno = resultado.Rows[0]["LOCATION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["WAREHOUSE"].ToString().Trim();
                }
            }

            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }
            // if (resultado.Rows.Count > 0) { retorno = resultado.Rows[0]["DESCRIPCION"].ToString(); }

            return(retorno);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List <Ent_ttscol100> parameterCollection = new List <Ent_ttscol100>();
            Ent_ttscol100        obj = new Ent_ttscol100();

            foreach (GridViewRow fila in grdRecords.Rows)
            {
                DropDownList lista = ((DropDownList)fila.Cells[6].Controls[1]);
                if (lista != null)
                {
                    if (Convert.ToInt32(lista.SelectedValue) == 1)
                    {
                        obj      = new Ent_ttscol100();
                        obj.orno = txtWorkOrder.Text.Trim();
                        obj.item = fila.Cells[0].Text;
                        obj.loca = fila.Cells[2].Text;
                        obj.cwar = fila.Cells[3].Text.Trim();
                        string toreturn = fila.Cells[4].Text;
                        obj.qdel    = Decimal.Parse(toreturn, System.Globalization.CultureInfo.InvariantCulture);
                        obj.refcntd = 0;
                        obj.refcntu = 0;
                        obj.mess    = " ";
                        obj.conf    = Convert.ToInt32(lista.SelectedValue);;
                        obj.cusr    = Session["user"].ToString();

                        obj.idrecord = grdRecords.DataKeys[fila.RowIndex].Value.ToString();
                        parameterCollection.Add(obj);
                    }
                }
            }
            idal.actualizarRegistro_Param(ref parameterCollection, ref strError);
            if (strError != string.Empty)
            {
                lblResult.Text = strError;
                throw new System.InvalidOperationException(strError);
            }
            printResult.Visible = true;
            lblResult.Text      = Recordswassavedsuccesfully;

            grdRecords.DataSource = Recordswassavedsuccesfully;
            grdRecords.DataBind();
        }
Пример #7
0
        public DataTable spareDelivery_listaRegistrosOrdenParam(ref Ent_ttscol100 Parametros, ref string strError)
        {
            method = MethodBase.GetCurrentMethod();

            paramList = new Dictionary <string, object>();
            paramList.Add("p1", Parametros.orno.Trim().ToUpperInvariant());
            strSentencia = recursos.readStatement(method.ReflectedType.Name, method.Name, ref owner, ref env, tabla, paramList);

            try
            {
                consulta = DAL.BaseDAL.BaseDal.EjecutarCons("Text", strSentencia, ref parametersOut, null, true);
                if (consulta.Rows.Count < 1)
                {
                    strError = "Service order doesn't exist or status doesn't allowed. Cannot Continue.";
                }
            }
            catch (Exception ex)
            {
                log.escribirError(strError + Console.Out.NewLine + ex.Message, stackTrace.GetFrame(1).GetMethod().Name, method.Name, method.ReflectedType.Name);
            }
            return(consulta);
        }