예제 #1
0
        protected void BindDDdlDestino(string Tercero)
        {
            string LtxtSql = string.Format("EXEC SP_PANTALLA_Asignacion 3,'','','WEB','{0}',0,0,0,{1},'01-1-2009','01-01-1900','01-01-1900'", Tercero.ToString().Trim(), Session["!dC!@"]);

            DdlBodDest.DataSource     = Cnx.DSET(LtxtSql);
            DdlBodDest.DataMember     = "Datos";
            DdlBodDest.DataTextField  = "Bodega";
            DdlBodDest.DataValueField = "CodUbicaBodega";
            DdlBodDest.DataBind();
        }
        //********************** Traslado Bodega *************************************
        protected void BindDDdlDestino(string filtro)
        {
            DtAll = (DataTable)ViewState["DtAll"];
            DataTable DTDstn = new DataTable();

            DataRow[] Result;
            DTDstn = DtAll.Clone();
            switch (filtro)
            {
            case "REPA":
                Result = DtAll.Select("Filtro='ASIGNAC' AND ((Descr='REPA' AND EstadBod='02') OR (Descr='MANTO' AND EstadBod='02') OR (Descr='POSBAJA' AND EstadBod='06') OR Descr=' - ')");
                foreach (DataRow Row in Result)
                {
                    DTDstn.ImportRow(Row);
                }
                break;

            case "BAJA":

                break;

            case "SP":
                Result = DtAll.Select("Filtro='ASIGNAC' AND (Descr='REPA' AND EstadBod='02' OR Descr=' - ')");
                foreach (DataRow Row in Result)
                {
                    DTDstn.ImportRow(Row);
                }
                break;

            case "MANTO":
                Result = DtAll.Select("Filtro='ASIGNAC' AND (Descr='REPA' AND EstadBod='02' OR Descr=' - ')");
                foreach (DataRow Row in Result)
                {
                    DTDstn.ImportRow(Row);
                }
                break;

            default:    // Disponible
                Result = DtAll.Select("Filtro='ASIGNAC' AND (EstadBod='01' OR EstadBod='06' OR EstadBod='80' OR Descr=' - ')");
                foreach (DataRow Row in Result)
                {
                    DTDstn.ImportRow(Row);
                }
                break;
            }
            DdlBodDest.DataSource     = DTDstn;
            DdlBodDest.DataTextField  = "Descr";
            DdlBodDest.DataValueField = "Cod";
            DdlBodDest.DataBind();
        }