Esempio n. 1
0
        /// <summary>
        /// se realiza consulta para cuando venga del modulo planning solo muestre la información por el cliente del usuario
        /// 22/02/2011 Magaly Jiménez
        /// </summary>
        /// <param name="iid_Brand"></param>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="iCompany_id"></param>
        /// <returns></returns>
        public DataTable ObtenerBrandPlanning(int iid_Brand, string sid_ProductCategory, string sName_Brand, int iCompany_id)
        {
            oConn = new Conexion(1);
            DataTable dt = oConn.ejecutarDataTable("UP_WEB_SEARCHBRANDPLANNING", iid_Brand, sid_ProductCategory, sName_Brand, iCompany_id);

            oConn = null;
            EBrand oeBrandPla = new EBrand();

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i <= dt.Rows.Count - 1; i++)
                    {
                        oeBrandPla.id_Brand           = Convert.ToInt32(dt.Rows[i]["id_Brand"].ToString().Trim());
                        oeBrandPla.id_ProductCategory = dt.Rows[i]["id_ProductCategory"].ToString().Trim();
                        oeBrandPla.Company_id         = Convert.ToInt32(dt.Rows[i]["Company_id"].ToString().Trim());
                        oeBrandPla.Name_Brand         = dt.Rows[i]["Name_Brand"].ToString().Trim();
                        oeBrandPla.Brand_Status       = Convert.ToBoolean(dt.Rows[i]["Brand_Status"].ToString().Trim());
                        oeBrandPla.Brand_CreateBy     = dt.Rows[i]["Brand_CreateBy"].ToString().Trim();
                        oeBrandPla.Brand_DateBy       = Convert.ToDateTime(dt.Rows[i]["Brand_DateBy"].ToString().Trim());
                        oeBrandPla.Brand_ModiBy       = dt.Rows[i]["Brand_ModiBy"].ToString().Trim();
                        oeBrandPla.Brand_DateModiBy   = Convert.ToDateTime(dt.Rows[i]["Brand_DateModiBy"].ToString().Trim());
                    }
                }
                return(dt);
            }
            else
            {
                return(null);
            }
        }
        public CreditCard
        (
            string referenceName,
            string color,
            EBrand brand,
            string holderName,
            string number,
            string expirationDate,
            string verificationCode,
            int dueDay,
            int invoiceClosingDay,
            double limit,
            Member holder
        ) : this()
        {
            ReferenceName     = referenceName;
            Color             = color;
            Brand             = brand;
            HolderName        = holderName;
            Number            = number;
            ExpirationDate    = expirationDate;
            VerificationCode  = verificationCode;
            DueDay            = dueDay;
            InvoiceClosingDay = invoiceClosingDay;
            Limit             = limit;

            if (holder == null)
            {
                return;
            }

            SetHolder(holder);
        }
Esempio n. 3
0
        public PartialViewResult Menu(EGender gender           = EGender.UNISEX, Decimal age = 0,
                                      bool categoryOn          = false, ECategory category   = ECategory.OTHERS,
                                      bool brandOn             = false, EBrand brand         = EBrand.UNKNOWN,
                                      Decimal minimumPrice     = 0, Decimal maximumPrice     = 0,
                                      EColorSeries colorSeries = EColorSeries.ANY, string keyword = "")
        {
            ViewBag.CategoryOn       = categoryOn;
            ViewBag.SelectedCategory = category;

            IEnumerable <ECategory> categories      = repository.Products.Select(x => x.Category).Distinct().OrderBy(x => x);
            IEnumerable <string>    categoryStrings = CategoryClass.Categories.Select(x => x.Value.Item2);
            NavFilterViewModel      navViewModel    = new NavFilterViewModel()
            {
                Gender          = gender,
                Age             = age,
                CategoryOn      = categoryOn,
                Category        = category,
                BrandOn         = brandOn,
                Brand           = brand,
                MinimumPrice    = minimumPrice,
                MaximumPrice    = maximumPrice,
                ColorSeries     = colorSeries,
                KeyWord         = keyword,
                CategoryStrings = categoryStrings.ToArray()
            };

            return(PartialView(categoryStrings.ToList()));
        }
        public EBrand RandomBrand()
        {
            random = new Random();
            EBrand randomEnum = (EBrand)values.GetValue(random.Next(values.Length));

            Console.WriteLine(randomEnum);
            return(randomEnum);
        }
Esempio n. 5
0
        /// <summary>
        /// inserta categoria y marca en la bd intemerdia en la tabla TBL_MARCA_CATEGORIA
        /// 16/02/2011  Magaly Jiménez
        /// </summary>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="sid_Brand"></param>
        /// <returns></returns>
        public EBrand RegistrarBrandCategorytmp(string sid_ProductCategory, string sid_Brand)
        {
            DBrand odrBrandcategorytmp = new DBrand();
            EBrand oeBrandcategorytmp  = odrBrandcategorytmp.RegistrarBrandCategoryPKTMP(sid_ProductCategory, sid_Brand);

            odrBrandcategorytmp = null;
            return(oeBrandcategorytmp);
        }
Esempio n. 6
0
        /// <summary>
        /// inserta marca en BD intermedia
        /// 28/01/2011 Magaly Jiménez
        /// </summary>
        /// <param name="iCompany_id"></param>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <param name="sBrand_CreateBy"></param>
        /// <param name="tBrand_DateBy"></param>
        /// <param name="sBrand_ModiBy"></param>
        /// <param name="tBrand_DateModiBy"></param>
        /// <returns></returns>
        public EBrand RegistrarBrandtmp(int iCompany_id, int iidBrand, string sName_Brand, bool bBrand_Status)
        {
            DBrand odrBrandtmp = new DBrand();
            EBrand oeBrandtmp  = odrBrandtmp.RegistrarBrandPKTMP(iCompany_id, iidBrand, sName_Brand, bBrand_Status);

            odrBrandtmp = null;
            return(oeBrandtmp);
        }
Esempio n. 7
0
        /// <summary>
        /// Metodo que permite registrar Marca de producto
        /// Modificación: se agrega campo company_id de tipo int.
        /// 17/08/2010 Magaly Jiménez
        /// 30/11/2010 se adiciona sid_ProductCategory y lid_Subcategory . Ing. Mauricio Ortiz
        /// </summary>

        /// <param name="lid_Subcategory"></param>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="iCompany_id"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <param name="sBrand_CreateBy"></param>
        /// <param name="tBrand_DateBy"></param>
        /// <param name="sBrand_ModiBy"></param>
        /// <param name="tBrand_DateModiBy"></param>
        /// <returns>oeBrand</returns>
        public EBrand RegistrarBrand(int iCompany_id, string sid_ProductCategory, string sName_Brand, bool bBrand_Status, string sBrand_CreateBy, DateTime tBrand_DateBy, string sBrand_ModiBy, DateTime tBrand_DateModiBy)
        {
            DBrand odrBrand = new DBrand();
            EBrand oeBrand  = odrBrand.RegistrarBrandPK(iCompany_id, sid_ProductCategory, sName_Brand, bBrand_Status, sBrand_CreateBy, tBrand_DateBy, sBrand_ModiBy, tBrand_DateModiBy);

            odrBrand = null;
            return(oeBrand);
        }
Esempio n. 8
0
        /// <summary>
        /// Actuliza información  en la BD Intermedia
        /// 28/01/2011 Magaly Jiménez
        /// </summary>
        /// <param name="iid_Brand"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <returns></returns>
        public EBrand Actualizar_BrandTMP(int iid_Brand, string sName_Brand, bool bBrand_Status, string scategory)
        {
            DBrand odaBrandtmp = new DBrand();
            EBrand oeaBrandtmp = odaBrandtmp.Actualizar_BrandTMP(iid_Brand, sName_Brand, bBrand_Status, scategory);

            odaBrandtmp = null;
            return(oeaBrandtmp);
        }
Esempio n. 9
0
        //----Metodo que permite Actualizar Marca de producto
        /// <summary>
        ///  Modificación: se agrega campo company_id de tipo int.
        /// 17/08/2010 Magaly Jiménez
        /// 30/11/2010 se adiciona sid_ProductCategory y lid_Subcategory . Ing. Mauricio Ortiz
        /// </summary>
        /// <param name="iid_Brand"></param>
        /// <param name="iCompany_id"></param>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="lid_Subcategory"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <param name="sBrand_ModiBy"></param>
        /// <param name="tBrand_DateModiBy"></param>
        /// <returns>oeaBrand</returns>
        public EBrand Actualizar_Brand(int iid_Brand, int iCompany_id, string sid_ProductCategory, string sName_Brand, bool bBrand_Status, string sBrand_ModiBy, DateTime tBrand_DateModiBy)
        {
            DBrand odaBrand = new DBrand();
            EBrand oeaBrand = odaBrand.Actualizar_Brand(iid_Brand, iCompany_id, sid_ProductCategory, sName_Brand, bBrand_Status, sBrand_ModiBy, tBrand_DateModiBy);

            odaBrand = null;
            return(oeaBrand);
        }
Esempio n. 10
0
        /// <summary>
        /// retorna id de compañia y categoria para carga masiva de marca.
        /// 02/03/2011 Magaly Jiménez
        /// </summary>
        /// <param name="sCompany_Name"></param>
        /// <param name="sProduct_Category"></param>
        /// <returns></returns>
        public DataSet Searchidcompanycategory(string sCompany_Name, string sProduct_Category)
        {
            DBrand  odsBrandid = new DBrand();
            EBrand  oeBrandid  = new EBrand();
            DataSet dsBrandid  = odsBrandid.ObteneridCompanyCategory(sCompany_Name, sProduct_Category);

            odsBrandid = null;
            return(dsBrandid);
        }
Esempio n. 11
0
        /// <summary>
        /// Metodo de Consulta de Marcas de producto
        //  Modificación : 30/11/2010 se adiciona paramentros a la consulta
        //                sid_ProductCategory, Ing. Mauricio Ortiz
        /// </summary>
        /// <param name="iid_Brand"></param>
        /// <param name="sName_Brand"></param>
        /// <returns></returns>
        public DataTable SearchBrand(int iid_Brand, string sid_ProductCategory, string sName_Brand)
        {
            DBrand    odsBrand = new DBrand();
            EBrand    oeBrand  = new EBrand();
            DataTable dtBrand  = odsBrand.ObtenerBrand(iid_Brand, sid_ProductCategory, sName_Brand);

            odsBrand = null;
            return(dtBrand);
        }
Esempio n. 12
0
        /// <summary>
        ///  se realiza consulta para cuando venga del modulo planning solo muestre la información por el cliente del usuario
        /// 22/02/2011 Magaly Jiménez
        /// </summary>
        /// <param name="iid_Brand"></param>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="iCompany_id"></param>
        /// <returns></returns>
        public DataTable SearchBrandPlanning(int iid_Brand, string sid_ProductCategory, string sName_Brand, int iCompany_id)
        {
            DBrand    odsBrandPla = new DBrand();
            EBrand    oeBrand     = new EBrand();
            DataTable dtBrandpla  = odsBrandPla.ObtenerBrandPlanning(iid_Brand, sid_ProductCategory, sName_Brand, iCompany_id);

            odsBrandPla = null;
            return(dtBrandpla);
        }
Esempio n. 13
0
        /// <summary>
        /// Inserta Categoria y marca en la bd intemerdia en la tabla TBL_MARCA_CATEGORIA
        /// 16/02/2011  Magaly Jiménez
        /// </summary>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="sid_Brand"></param>
        /// <returns></returns>
        public EBrand RegistrarBrandCategoryPKTMP(string sid_ProductCategory, string sid_Brand)
        {
            oConn = new Conexion(2);
            DataTable dt = oConn.ejecutarDataTable("UP_WEBXPLORA_REGISTER_BRANDCATEGORYTMP", sid_ProductCategory, sid_Brand);

            oConn = null;
            EBrand oerbrandCtmp = new EBrand();

            oerbrandCtmp.id_ProductCategory = sid_ProductCategory;
            oerbrandCtmp.id_Brand           = Convert.ToInt32(sid_Brand);
            return(oerbrandCtmp);
        }
Esempio n. 14
0
        /// <summary>
        /// Actuliza información  en la BD Intermedia
        /// 28/01/2011 Magaly Jiménez
        /// </summary>
        /// <param name="iid_Brand"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <returns></returns>
        public EBrand Actualizar_BrandTMP(int iid_Brand, string sName_Brand, bool bBrand_Status, string scategory)
        {
            oConn = new Conexion(2);
            DataTable dt = oConn.ejecutarDataTable("UP_WEBXPLORA_AD_ACTUALIZAR_BRANDTMP", iid_Brand, sName_Brand, bBrand_Status, scategory);

            oConn = null;
            EBrand oeaBrandTMP = new EBrand();

            oeaBrandTMP.Name_Brand   = sName_Brand;
            oeaBrandTMP.Brand_Status = bBrand_Status;
            return(oeaBrandTMP);
        }
        public async Task <IActionResult> Edit(int id, EBrand Brand, string Model, int PassengerCount, int PricePerDay, int Year, EColor Color, int Volume, IFormFile ImageMimeType)
        {
            var car = _context.Auto.Find(id);

            if (car == null)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    car.Brand          = Brand;
                    car.Color          = Color;
                    car.PassengerCount = PassengerCount;
                    car.PricePerDay    = PricePerDay;
                    car.Model          = Model;
                    car.Volume         = Volume;
                    car.Year           = Year;
                    if (ImageMimeType != null)
                    {
                        byte[] imageData = null;
                        // считываем переданный файл в массив байтов
                        using (var binaryReader = new BinaryReader(ImageMimeType.OpenReadStream()))
                        {
                            imageData = binaryReader.ReadBytes((int)ImageMimeType.Length);
                        }
                        // установка массива байтов
                        car.ImageData = imageData;
                    }



                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AutoExists(id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }
Esempio n. 16
0
        /// <summary>
        /// Inserta marca en BD intermedia
        /// 28/01/2011 Magaly Jiménez
        /// Modificación: 13/06/2011 - Angel Ortiz - Se  agrega captura de tipo de Cliente y se realiza conexion directa a DB intermedia.
        /// Modificación: 08/11/2011 - Carlos Marin - se hace un convert al campo status para el registro de la bd intermedia ya que acepta 1 ó 0
        /// </summary>
        /// <param name="iCompany_id"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <returns></returns>
        public EBrand RegistrarBrandPKTMP(int iCompany_id, int iidBrand, string sName_Brand, bool bBrand_Status)
        {
            oConn = new Conexion(1);
            int CompanyType = Convert.ToInt32(oConn.ejecutarEscalar("UP_WEBXPLORA_OBTENER_TIPO_CLIENTE", iCompany_id));

            oConn = null;
            oConn = new Conexion(2);
            DataTable dt = oConn.ejecutarDataTable("UP_WEBXPLORA_AD_REGISTER_BRANDTMP", CompanyType, iidBrand, sName_Brand, Convert.ToInt16(bBrand_Status));

            oConn = null;
            EBrand oerbrandtmp = new EBrand();

            oerbrandtmp.Company_id = iCompany_id;
            return(oerbrandtmp);
        }
Esempio n. 17
0
        /// <summary>
        ///Nombre Metodo: ACTUALIZAR_BRAND
        ///Función: Permite Actualizar marcas productos
        /// Modificiacón:se agrega campo de Company_id como int.
        ///  17/08/2010 Magaly jimenez
        ///  30/11/2010 se adiciona sid_ProductCategory y lid_Subcategory . Ing. Mauricio Ortiz
        ///  01/12/2010 se quita lid_Subcategory . Ing. Magaly Jiménez
        /// </summary>
        /// <param name="iid_Brand"></param>
        /// <param name="iCompany_id"></param>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="lid_Subcategory"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <param name="sBrand_ModiBy"></param>
        /// <param name="tBrand_DateModiBy"></param>
        /// <returns>oeaBrand</returns>
        public EBrand Actualizar_Brand(int iid_Brand, int iCompany_id, string sid_ProductCategory, string sName_Brand, bool bBrand_Status, string sBrand_ModiBy, DateTime tBrand_DateModiBy)
        {
            oConn = new Conexion(1);
            DataTable dt = oConn.ejecutarDataTable("UP_WEB_ACTUALIZAR_BRAND", iid_Brand, iCompany_id, sid_ProductCategory, sName_Brand, bBrand_Status, sBrand_ModiBy, tBrand_DateModiBy);

            oConn = null;
            EBrand oeaBrand = new EBrand();

            oeaBrand.Company_id         = iCompany_id;
            oeaBrand.id_ProductCategory = sid_ProductCategory;
            oeaBrand.Name_Brand         = sName_Brand;
            oeaBrand.Brand_Status       = bBrand_Status;
            oeaBrand.Brand_ModiBy       = sBrand_ModiBy;
            oeaBrand.Brand_DateModiBy   = tBrand_DateModiBy;
            return(oeaBrand);
        }
Esempio n. 18
0
        /// <summary>
        /// Metodo para Registrar Marcas de Producto
        ///  Modificación: se agrega campo de Company_id como int.
        ///  17/08/2010 Magaly jimenez
        ///  30/11/2010 se adiciona sid_ProductCategory y lid_Subcategory . Ing. Mauricio Ortiz
        ///  01/12/2010 se quita lid_Subcategory . Ing. Magaly Jiménez
        /// </summary>
        /// <param name="lid_Subcategory"></param>
        /// <param name="sid_ProductCategory"></param>
        /// <param name="iCompany_id"></param>
        /// <param name="sName_Brand"></param>
        /// <param name="bBrand_Status"></param>
        /// <param name="sBrand_CreateBy"></param>
        /// <param name="tBrand_DateBy"></param>
        /// <param name="sBrand_ModiBy"></param>
        /// <param name="tBrand_DateModiBy"></param>
        /// <returns>dt</returns>
        public EBrand RegistrarBrandPK(int iCompany_id, string sid_ProductCategory, string sName_Brand, bool bBrand_Status, string sBrand_CreateBy, DateTime tBrand_DateBy, string sBrand_ModiBy, DateTime tBrand_DateModiBy)
        {
            oConn = new Conexion(1);
            int idBrand = Convert.ToInt32(oConn.ejecutarEscalar("UP_WEB_REGISTER_BRAND", iCompany_id, sid_ProductCategory, sName_Brand, bBrand_Status, sBrand_CreateBy, tBrand_DateBy, sBrand_ModiBy, tBrand_DateModiBy));

            oConn = null;
            EBrand oerbrand = new EBrand();

            oerbrand.id_Brand           = idBrand;
            oerbrand.id_ProductCategory = sid_ProductCategory;
            oerbrand.Company_id         = iCompany_id;
            oerbrand.Name_Brand         = sName_Brand;
            oerbrand.Brand_Status       = bBrand_Status;
            oerbrand.Brand_CreateBy     = sBrand_CreateBy;
            oerbrand.Brand_DateBy       = tBrand_DateBy;
            oerbrand.Brand_ModiBy       = sBrand_ModiBy;
            oerbrand.Brand_DateModiBy   = tBrand_DateModiBy;
            return(oerbrand);
        }