예제 #1
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(this.cmbEmpleados.SelectedValue) > 0 && Convert.ToInt32(this.cmbTablasIndice.SelectedValue) > 0)
            {
                //si es el acumlado de bruto para sac (cod. 15) se actualiza sobre indice 2 (tipo liq sac)
                if (Convert.ToInt32(this.cmbTablasIndice.SelectedValue)==15)
                    acumulado = new Acumulado(Convert.ToInt32(this.cmbAnios.SelectedValue.ToString() + this.cmbMeses.SelectedValue.ToString().PadLeft(2, '0')), 2, Convert.ToInt32(this.cmbEmpleados.SelectedValue), Convert.ToInt32(this.cmbTablasIndice.SelectedValue), this.cmbTablasIndice.Text ,Convert.ToDouble(this.txtValor.Text));
                else
                    acumulado = new Acumulado(Convert.ToInt32(this.cmbAnios.SelectedValue.ToString() + this.cmbMeses.SelectedValue.ToString().PadLeft(2, '0')), 0, Convert.ToInt32(this.cmbEmpleados.SelectedValue), Convert.ToInt32(this.cmbTablasIndice.SelectedValue), this.cmbTablasIndice.Text ,Convert.ToDouble(this.txtValor.Text));
                acumulados.Insert(0, acumulado);

                this.dgvAcumulados.DataSource = null;
                this.dgvAcumulados.DataSource = this.acumulados;

                //formatea DGV
                this.dgvAcumulados.Columns["anioMes"].DisplayIndex = 0;
                this.dgvAcumulados.Columns["legajo"].DisplayIndex = 1;
                this.dgvAcumulados.Columns["codigo"].DisplayIndex = 2;
                this.dgvAcumulados.Columns["descripcion"].DisplayIndex = 3;
                this.dgvAcumulados.Columns["valor"].DisplayIndex = 4;
                Controles.setEstandarDataGridView(this.dgvAcumulados);

                //graba datos del registro
                Model.DB.ejecutarProceso(Model.TipoComando.SP, "acumuladosActualizar", "@anioMes", acumulado.AnioMes , "@indice", acumulado.Indice , "@legajo", acumulado.Legajo ,"@codigo", acumulado.Codigo, "@valor",acumulado.Valor);
            }
            else
                MessageBox.Show("Hay datos invalidos. Verifique !!");
            this.txtLegajo.Focus();
        }
예제 #2
0
파일: Acumulados.cs 프로젝트: hvivani/SOffT
 /// <summary>
 /// verifica si un codigo existe en la coleccion
 /// </summary>
 /// <param name="ce"></param>
 /// <returns></returns>
 public bool existeCodigo(Acumulado ce)
 {
     Boolean salida = false;
     foreach (Acumulado c in this)
     {
         if (c.Codigo == ce.Codigo)
             salida = true;
     }
     return salida;
 }
예제 #3
0
        public Acumulado Get()
        {
            // GET: api/lastWeekAccumulated
            CoTecDBEntities db = new CoTecDBEntities();

            // Access stored procedure from data base
            var lWsp       = db.Database.SqlQuery <LastWeekAccumulated>("getLastWeekAccumulated");
            var totalAccSp = db.Database.SqlQuery <TotalAccumulated>("getTotalAccumulated");


            Acumulado acumulado = new Acumulado();

            // Sets values in list to be returned
            foreach (LastWeekAccumulated item in lWsp)
            {
                activeDay.Add(item.ACTIVE);
                deadDay.Add(item.DEAD);
                infectedDay.Add(item.INFECTED);
                recoveredDay.Add(item.RECOVERED);
                dates.Add((DateTime)item.Date);
            }

            acumulado.active_day    = activeDay.ToArray();
            acumulado.dead_day      = activeDay.ToArray();
            acumulado.recovered_day = activeDay.ToArray();
            acumulado.infected_day  = activeDay.ToArray();
            acumulado.Dates         = dates.ToArray();

            foreach (TotalAccumulated item in totalAccSp)
            {
                active    = item.ACTIVE;
                recovered = item.RECOVERED;
                infected  = item.INFECTED;
                dead      = item.DEAD;
            }

            acumulado.ACTIVE    = active;
            acumulado.RECOVERED = recovered;
            acumulado.INFECTED  = infected;
            acumulado.DEAD      = dead;

            return(acumulado);
        }
예제 #4
0
파일: Acumulados.cs 프로젝트: hvivani/SOffT
 public void Insert(int index, Acumulado item)
 {
     List.Insert(index, item);
 }
예제 #5
0
파일: Acumulados.cs 프로젝트: hvivani/SOffT
 public int IndexOf(Acumulado item)
 {
     return List.IndexOf(item);
 }
예제 #6
0
파일: Acumulados.cs 프로젝트: hvivani/SOffT
 public void CopyTo(Acumulado[] array, int index)
 {
     List.CopyTo(array, index);
 }
예제 #7
0
파일: Acumulados.cs 프로젝트: hvivani/SOffT
 public bool Contains(Acumulado item)
 {
     return List.Contains(item);
 }
예제 #8
0
파일: Acumulados.cs 프로젝트: hvivani/SOffT
 public int Add(Acumulado item)
 {
     return List.Add(item);
 }
예제 #9
0
파일: Acumulados.cs 프로젝트: hvivani/SOffT
 public void Remove(Acumulado item)
 {
     List.Remove(item);
 }