示例#1
0
        public static clsCostCenter TraerXId(int iCostCenter_id)
        {
            DAOCostCenter daoProxy = new DAOCostCenter();
            DataSet dtsProxy = daoProxy.TraerCentrodeCostosXId(iCostCenter_id);

            return Cargar(dtsProxy.Tables[0].Rows[0]);
        }
示例#2
0
        public static List<clsCostCenter> Traer()
        {
            DAOCostCenter daoProxy = new DAOCostCenter();
            DataSet dtsProxy = daoProxy.SelectAll();

            return CargarLista(dtsProxy.Tables[0]);
        }
示例#3
0
        public static int Insert(clsCostCenter objProxy)
        {
            ValidationException x = new ValidationException();
            if (string.IsNullOrEmpty(objProxy.SCostCente_name))
                x.AgregarError("Ingrese el nombre del centro de costo");

            if (x.Cantidad > 0)
                throw x;

            DAOCostCenter daoProxy = new DAOCostCenter();
            return daoProxy.Insert(objProxy.SCostCente_name, objProxy.SCostCenter_desc, objProxy.DGestion_time);
        }
示例#4
0
        public static bool Eliminar(int iCostCenter_id)
        {
            ValidationException x = new ValidationException();
            if (iCostCenter_id <= 0)
                x.AgregarError("Ingrese el código");

            if (x.Cantidad > 0)
                throw x;

            DAOCostCenter daoProxy = new DAOCostCenter();
            return daoProxy.Eliminar(iCostCenter_id);
        }
示例#5
0
        public static bool Update(clsCostCenter objProxy)
        {
            ValidationException x = new ValidationException();
            if (objProxy.ICostCenter_id <= 0)
                x.AgregarError("Ingrese el código");

            if (string.IsNullOrEmpty(objProxy.SCostCente_name))
                x.AgregarError("Ingrese el nombre del centro");

            if (x.Cantidad > 0)
                throw x;

            DAOCostCenter daoProxy = new DAOCostCenter();
            return daoProxy.Update(objProxy.ICostCenter_id, objProxy.SCostCente_name, objProxy.SCostCenter_desc, objProxy.DGestion_time);
        }