Beispiel #1
0
 /// <summary>
 /// Actualiza toda la información del AnalisisItem, consultando la Base de Datos
 /// </summary>
 //public void update()
 //{
 //    if (this.Category == "Presupuesto")
 //    {
 //        Presupuesto pres = Presupuesto.getById(this.id);
 //        this.update(Tools.GetItemFromPresupuesto(pres));
 //    }
 //    if (this.Category == "Grupo")
 //    {
 //        RubroPres grupo = RubroPres.getByid(this.id);
 //        this.update(Tools.GetItemFromRubroPres(grupo));
 //    }
 //    if (this.Category == "Item")
 //    {
 //        TareaPres tarea = TareaPres.getById(this.id);
 //        this.update(tarea.toItems());
 //    }
 //}
 public static void getAllChilds(AnalisisItem item, List <AnalisisItem> lst)
 {
     if (item.lstChilds != null)
     {
         foreach (AnalisisItem item1 in item.lstChilds)
         {
             lst.Add(item1);
             if (item1.lstChilds.Count > 0)
             {
                 getAllChilds(item1, lst);
             }
         }
     }
     lst = lst.OrderBy(x => x.orden).ThenBy(x => x.nombre).ToList();
 }
Beispiel #2
0
        /// <summary>
        /// Convert the Estimate into a AnalisisItem. This Item can be used with a ListView control
        /// </summary>
        public AnalisisItem toItems()
        {
            AnalisisItem item = new AnalisisItem();

            item.Category    = "Presupuesto";
            item.id          = this.id;
            item.parentId    = 0;
            item.orden       = 0;
            item.wbs         = "";
            item.nombre      = this.nombre.ToUpper();
            item.unidad      = "";
            item.consumo     = 0;
            item.coeficiente = this.coef_resumen;
            return(item);
        }
Beispiel #3
0
        public AnalisisItem toItems()
        {
            Presupuesto  pres = Presupuesto.getById(this.pres_id);
            AnalisisItem item = new AnalisisItem();

            item.Category      = "Grupo";
            item.id            = this.id;
            item.parentId      = this.rubropres_id;
            item.orden         = this.orden;
            item.wbs           = this.wbs;
            item.nombre        = this.nombre;
            item.consumo       = 0;
            item.unidad        = "";
            item.coeficiente   = pres.coef_resumen;
            item.tieneRecursos = false;
            return(item);
        }
Beispiel #4
0
 /// <summary>
 /// Actualiza toda la información de un AnalisisItem, a partir de otro AnalisisItem
 /// </summary>
 public void update(AnalisisItem item)
 {
     this.Category      = item.Category;
     this.coeficiente   = item.coeficiente;
     this.consumo       = item.consumo;
     this.costoEquipos  = item.costoEquipos;
     this.costoManoObra = item.costoManoObra;
     this.costoMaterial = item.costoMaterial;
     this.costoTotal    = item.costoTotal;
     this.costoUnit     = item.costoUnit;
     this.incidencia    = item.incidencia;
     this.nombre        = item.nombre;
     this.orden         = item.orden;
     this.parentId      = item.parentId;
     this.precioVenta   = item.precioVenta;
     this.unidad        = item.unidad;
     this.wbs           = item.wbs;
     this.tieneRecursos = item.tieneRecursos;
     this.lstChilds     = item.lstChilds;
 }
Beispiel #5
0
        //public abstract void UpdateTieneHijos();
        #endregion
        /// <summary>
        /// Convierte el ItemPres en un AnalisisItem
        /// </summary>
        public AnalisisItem ToItem()
        {
            AnalisisItem item = new AnalisisItem();

            item.id          = this.id;
            item.Category    = this.categoria;
            item.wbs         = this.wbs;
            item.nombre      = this.nombre;
            item.consumo     = this.consumo;
            item.unidad      = this.unidad;
            item.costoUnit   = this.costoUnitario;
            item.costoTotal  = this.costoTotal;
            item.coeficiente = 1;
            item.precioVenta = this.precioVenta;
            item.lstChilds   = new List <AnalisisItem>();
            item.parentId    = this.rubropres_id;
            if (this.tieneRecursos())
            {
                item.tieneRecursos = true;
            }

            return(item);
        }