コード例 #1
0
 private void lbxRazon()
 {
     if (m_frmAction == frmAction.Read)
     {
         if (ddlTHBelong.SelectedValue == "2" /*=No*/)
         {
             string    selectedValuesString = "";
             NewSource NS   = new NewSource();
             DataTable Dref = new DataTable();
             Dref = NS.getRef("SPR_Ref_RazonTH", m_pk_perfil);
             if (Dref.Rows.Count > 0)
             {
                 foreach (DataRow r in Dref.Rows)
                 {
                     selectedValuesString += r[1].ToString() + ", ";
                 }
                 selectedValuesString = selectedValuesString.Substring(0, selectedValuesString.Length - 2);
                 Dref = null;
             }
             else
             {
                 selectedValuesString = "No hay valores seleccionados";
             }
             NS = null;
             divRazon.Visible = false;
             lblRazon.Text    = selectedValuesString;
         }
         else
         {
             divRazon.Visible    = false;
             divLblRazon.Visible = false;
         }
     }
     else
     {
         NewSource NS = new NewSource();
         DataTable Dt = new DataTable();
         Dt = NS.getAll("SPR_DROP_RazonTH");
         this.lbxRazonSeleccion.DataSource     = Dt;
         this.lbxRazonSeleccion.DataValueField = "PK_Razon";
         this.lbxRazonSeleccion.DataTextField  = "DE_Razon";
         this.lbxRazonSeleccion.DataBind();
         DataTable Dref = new DataTable();
         Dref = NS.getRef("SPR_Ref_RazonTH", m_pk_perfil);
         if (Dref.Rows.Count > 0)
         {
             foreach (DataRow r in Dref.Rows)
             {
                 System.Web.UI.WebControls.ListItem li = new ListItem(r[1].ToString(), r[0].ToString());
                 this.lbxRazonSeleccionado.Items.Add(li);
                 this.lbxRazonSeleccion.Items.Remove(li);
             }
             Dref = null;
         }
         Dt = null;
         NS = null;
         divLblRazon.Visible = false;
     }
 }
コード例 #2
0
 /// <inheritdoc />
 public override Change Clone()
 {
     return(new ResourceChange(
                Namespace,
                Name,
                Type,
                OldSource?.Clone(),
                NewSource?.Clone()));
 }
コード例 #3
0
        private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            if (_stopWatch.ElapsedMilliseconds > CaptureDelayMS)
            {
                DetectMotion(eventArgs.Frame.Clone() as Bitmap);

                NewSource?.Invoke(sender, eventArgs);
                _stopWatch.Restart();
            }

            eventArgs.Frame.Dispose();
        }
コード例 #4
0
        private void ddlCategoriasDeCentrosPrivadosALL()
        {
            NewSource NS = new NewSource();
            DataTable Dt = new DataTable();

            Dt = NS.getAll("SPR_DROP_CategoriasCentrosPrivados");
            this.ddlCategoriasDeCentrosPrivados.DataSource     = Dt;
            this.ddlCategoriasDeCentrosPrivados.DataValueField = "PK_CategoriaCentroPrivado";
            this.ddlCategoriasDeCentrosPrivados.DataTextField  = "DE_CategoriaCentroPrivado";
            this.ddlCategoriasDeCentrosPrivados.DataBind();
            Dt = null;
            NS = null;
        }
コード例 #5
0
        private void ddlTipoDeAdmisionAll()
        {
            NewSource NS = new NewSource();
            DataTable Dt = new DataTable();

            Dt = NS.getAll("SPR_DROP_TipoAdmision");
            this.ddlTipoDeAdmision.DataSource     = Dt;
            this.ddlTipoDeAdmision.DataValueField = "PK_TipoAdmision";
            this.ddlTipoDeAdmision.DataTextField  = "DE_TipoAdmision";
            this.ddlTipoDeAdmision.DataBind();
            Dt = null;
            NS = null;
        }
コード例 #6
0
        public void setValue()
        {
            NewSource NS   = new NewSource();
            DataTable Dref = new DataTable();

            Dref = NS.getRef("SPR_CategoriasCentrosPrivadosSelectedValue", pk_perfil);
            if (Dref.Rows.Count > 0)
            {
                this.ddlCategoriasDeCentrosPrivados.ClearSelection();
                this.ddlCategoriasDeCentrosPrivados.SelectedValue = Dref.Rows[0][0].ToString();
                Dref = null;
                NS   = null;
            }
        }
コード例 #7
0
    public void SelectSource(string s)
    {
        if (s == "ap")
        {
            mysource = NewSource.ap;
        }
        if (s == "pp")
        {
            mysource = NewSource.pp;
        }
        if (s == "cnn")
        {
            mysource = NewSource.cnn;
        }

        StartCoroutine(News());
    }
コード例 #8
0
        private void ddlTipoDeAdmisionAll()
        {
            NewSource NS = new NewSource();
            DataTable Dt = new DataTable();

            Dt = NS.getAll("SPR_DROP_TipoAdmision");
            this.ddlTipoDeAdmision.DataSource     = Dt;
            this.ddlTipoDeAdmision.DataValueField = "PK_TipoAdmision";
            this.ddlTipoDeAdmision.DataTextField  = "DE_TipoAdmision";
            this.ddlTipoDeAdmision.DataBind();

            if (UsaTipoDeAdmision(m_PK_Programa))
            {
                this.ddlTipoDeAdmision.Items.RemoveAt(6);
            }

            Dt = null;
            NS = null;
        }
コード例 #9
0
        private void ddlMilitarALL()
        {
            NewSource NS = new NewSource();
            DataTable Dt = new DataTable();

            Dt = NS.getAll("SPR_DROP_Militar");
            this.ddlMilitar.DataSource     = Dt;
            this.ddlMilitar.DataValueField = "PK_Militar";
            this.ddlMilitar.DataTextField  = "DE_Militar";
            try
            {
                this.ddlMilitar.DataBind();
            }
            catch
            {
                this.ddlMilitar.SelectedValue = "";
            }
            Dt = null;
            NS = null;
        }
コード例 #10
0
        private void ddlGeneroAll()
        {
            NewSource NS = new NewSource();
            DataTable Dt = new DataTable();

            Dt = NS.getAll("SPR_DROP_Genero");
            this.ddlGenero.DataSource     = Dt;
            this.ddlGenero.DataValueField = "PK_Genero";
            this.ddlGenero.DataTextField  = "DE_Genero";
            this.ddlGenero.ClearSelection();
            try
            {
                this.ddlGenero.DataBind();
            }
            catch
            {
                this.ddlGenero.SelectedValue = "";
            }
            Dt = null;
            NS = null;
        }
コード例 #11
0
        public void setValues()
        {
            NewSource NS   = new NewSource();
            DataTable Dref = new DataTable();

            Dref = NS.getRef("SPR_NewData", m_pk_perfil);
            if (Dref.Rows.Count > 0)
            {
                ddlMilitar.ClearSelection();
                ddlFamiliaMilitar.ClearSelection();
                ddlGenero.ClearSelection();
                ddlMilitar.SelectedValue        = Dref.Rows[0][0].ToString();
                ddlFamiliaMilitar.SelectedValue = Dref.Rows[0][1].ToString();
                ddlGenero.SelectedValue         = Dref.Rows[0][2].ToString();
                Dref = null;
                NS   = null;
            }
            if (isAdmision)
            {
                NS   = new NewSource();
                Dref = new DataTable();
                Dref = NS.getRef("SPR_TipoAdmisionSelectedValue", m_pk_perfil);
                if (Dref.Rows.Count > 0)
                {
                    if (Dref.Rows[0][0].ToString() != "0")
                    {
                        ddlTipoDeAdmision.ClearSelection();
                        ddlTipoDeAdmision.SelectedValue = Dref.Rows[0][0].ToString();
                    }
                    else
                    {
                        ddlTipoDeAdmision.ClearSelection();
                    }
                    Dref = null;
                    NS   = null;
                }
            }
        }
コード例 #12
0
    private void ddlEtapa()
    {
        NewSource NS = new NewSource();
        DataTable Dt = new DataTable();

        Dt = NS.getAll("SPR_DROP_EtapaTH");
        this.ddlTHEtapa.DataSource     = Dt;
        this.ddlTHEtapa.DataValueField = "PK_Etapa";
        this.ddlTHEtapa.DataTextField  = "DE_Etapa";
        try
        {
            this.ddlTHEtapa.DataBind();
            ListItem li = new ListItem("", "0");
            this.ddlTHEtapa.Items.Insert(0, li);
        }
        catch (Exception ex)
        {
            Trace.Write("DdlFrecuenciaBotellas()::" + ex.Message);
            throw ex;
        }
        Dt = null;
        NS = null;
    }
コード例 #13
0
        /// <summary>
        /// parse entity state for each item
        /// </summary>
        /// <param name="context"></param>
        public void Parse()
        {
            var addedItems = NewSource.Where(n => !ExistSource.Any(o => CompareObject(o, n))).ToList();

            var modifiedItems = NewSource.Where(n => ExistSource.Any(o => CompareObject(o, n))).ToList();

            var deletedItems = ExistSource.Where(o => !NewSource.Any(n => CompareObject(o, n))).ToList();

            foreach (var item in addedItems)
            {
                Context.Entry(item).State = EntityState.Added;
            }

            foreach (var item in deletedItems)
            {
                Context.Entry(item).State = EntityState.Deleted;
            }

            foreach (var item in modifiedItems)
            {
                Context.Entry(item).State = EntityState.Modified;
            }
        }
コード例 #14
0
    public void setValues()
    {
        NewSource NS   = new NewSource();
        DataTable Dref = NS.getRef("SPR_METADONA", m_pk_perfil);

        try
        {
            if (Dref.Rows.Count > 0)
            {
                if (Dref.Rows[0][0] != DBNull.Value)
                {
                    this.ddlTHBelong.SelectedValue = Dref.Rows[0][0].ToString();
                }
                if (Dref.Rows[0][1] != DBNull.Value)
                {
                    this.ddlTHEtapa.SelectedValue = Dref.Rows[0][1].ToString();
                }
                DateTime date;
                if (Dref.Rows[0][2] != DBNull.Value)
                {
                    date = (DateTime)Dref.Rows[0][2];
                    this.ddlFechaEntradaMes.SelectedValue = date.Month.ToString();
                    this.ddlFechaEntradaDía.SelectedValue = date.Day.ToString();
                    this.txtFechaEntradaAño.Text          = date.Year.ToString();
                }
                if (Dref.Rows[0][3] != DBNull.Value)
                {
                    date = (DateTime)Dref.Rows[0][3];
                    this.ddlFechaSalidaMes.SelectedValue = date.Month.ToString();
                    this.ddlFechaSalidaDía.SelectedValue = date.Day.ToString();
                    this.txtFechaSalidaAño.Text          = date.Year.ToString();
                }
                if (Dref.Rows[0][4] != DBNull.Value)
                {
                    this.txtCantidadBotellas.Text = Dref.Rows[0][4].ToString();
                }
                if (Dref.Rows[0][5] != DBNull.Value)
                {
                    this.ddlFrecuenciaBotellas.SelectedValue = Dref.Rows[0][5].ToString();
                }
                if (m_frmAction == frmAction.Read)
                {
                    if (Dref.Rows[0][2] != DBNull.Value)
                    {
                        lblFE_In.Text = ((DateTime)Dref.Rows[0][2]).ToShortDateString();
                    }
                    else
                    {
                        lblFE_In.Text = "No disponible";
                    }
                    if (Dref.Rows[0][3] != DBNull.Value)
                    {
                        lblFE_Out.Text = ((DateTime)Dref.Rows[0][3]).ToShortDateString();
                    }
                    else
                    {
                        lblFE_Out.Text = "No dispobible";
                    }
                    if (Dref.Rows[0][4] != DBNull.Value)
                    {
                        this.lblCantidadBotellas.Text = Dref.Rows[0][4].ToString();
                    }
                    if (Dref.Rows[0][6] != DBNull.Value)
                    {
                        this.lblFrecuenciaBotellas.Text = Dref.Rows[0][6].ToString();
                    }
                }

                switch (ddlTHBelong.SelectedValue)
                {
                case ("1"):
                    lbxRazonSeleccion.Attributes.Add("disabled", "true");
                    lbxRazonSeleccionado.Attributes.Add("disabled", "true");
                    btnAgregar.Enabled            = false;
                    btnEliminar.Enabled           = false;
                    ddlFechaEntradaDía.Enabled    = true;
                    ddlFechaEntradaMes.Enabled    = true;
                    ddlFechaSalidaDía.Enabled     = true;
                    ddlFechaSalidaMes.Enabled     = true;
                    ddlFrecuenciaBotellas.Enabled = true;
                    ddlTHEtapa.Enabled            = true;
                    txtCantidadBotellas.Enabled   = true;
                    txtFechaEntradaAño.Enabled    = true;
                    txtFechaSalidaAño.Enabled     = true;
                    break;

                case ("2"):
                    lbxRazonSeleccion.Attributes.Remove("disabled");
                    lbxRazonSeleccionado.Attributes.Remove("disabled");
                    btnEliminar.Enabled           = true;
                    btnAgregar.Enabled            = true;
                    ddlFechaEntradaDía.Enabled    = false;
                    ddlFechaEntradaMes.Enabled    = false;
                    ddlFechaSalidaDía.Enabled     = false;
                    ddlFechaSalidaMes.Enabled     = false;
                    ddlFrecuenciaBotellas.Enabled = false;
                    ddlTHEtapa.Enabled            = false;
                    txtCantidadBotellas.Enabled   = false;
                    txtFechaEntradaAño.Enabled    = false;
                    txtFechaSalidaAño.Enabled     = false;
                    break;

                default:
                    lbxRazonSeleccion.Attributes.Add("disabled", "true");
                    lbxRazonSeleccionado.Attributes.Add("disabled", "true");
                    btnAgregar.Enabled            = false;
                    btnEliminar.Enabled           = false;
                    ddlFechaEntradaDía.Enabled    = false;
                    ddlFechaEntradaMes.Enabled    = false;
                    ddlFechaSalidaDía.Enabled     = false;
                    ddlFechaSalidaMes.Enabled     = false;
                    ddlFrecuenciaBotellas.Enabled = false;
                    ddlTHEtapa.Enabled            = false;
                    txtCantidadBotellas.Enabled   = false;
                    txtFechaEntradaAño.Enabled    = false;
                    txtFechaSalidaAño.Enabled     = false;
                    break;
                }
            }
        }
        catch (Exception ex)
        {
            Trace.Write("setValues()::" + ex.Message);
            throw ex;
        }
        Dref = null;
        NS   = null;
    }