Exemplo n.º 1
0
 public MasterSQL ConvertToMasterSQL(Master master)
 {
     return(new MasterSQL()
     {
         MasterId = master.MasterId,
         ChatId = master.ChatId,
         codeB = master.codeB,
         Name = master.Name,
         TypeDeviceID = master.TypeDeviceID,
         TypeName = master.TypeName,
         IsActive = master.IsActive,
         Date = ConverterHelper.ConvertDateTimeToMillisec(DateTime.Now).ToString()
     });
 }
        protected override TripParticipant CreateValueFromReader(IDatabaseReader reader)
        {
            var tripParticipant = new TripParticipant
                                  (
                reader.GetInt("TRPIDT"),
                reader.GetString("USRPSD"),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDUSRPTP")),
                reader.GetDouble("TRPNOT"),
                reader.GetNullableDate("VALDAT")
                                  );

            tripParticipant.ModificationDate = reader.GetDate("DATEFT");
            return(tripParticipant);
        }
        protected override Friendship CreateValueFromReader(IDatabaseReader reader)
        {
            var friendship = new  Friendship
                             (
                reader.GetInt("USRIDT"),
                reader.GetString("FRDPSD"),
                reader.GetDate("STRDAT"),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDRSQUSR")),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDWTG"))
                             );

            friendship.ModificationDate = reader.GetDate("DATEFT");
            return(friendship);
        }
Exemplo n.º 4
0
        public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!ConverterHelper.IsValueValid(value))
            {
                return(DependencyProperty.UnsetValue);
            }
            if (value.Length != 2)
            {
                return(DependencyProperty.UnsetValue);
            }
            var enabled = (bool)value[0];

            return(enabled ? value[1] : new Thickness(0));
        }
Exemplo n.º 5
0
        public async Task <int> SavePowerTimeToSql(PowerPC powerpc)
        {
            int result = 0;

            if (powerpc == null)
            {
                return(result);
            }
            try
            {
                if (sqliteService == null)
                {
                    sqliteService = new SQLiteService <PowerPCSQL>(sqlitePlatform, await fileSystemService.GetPath(configuration.SqlDatabaseName));
                }
            }
            catch (Exception exp)
            {
                result        = -1;
                sqliteService = null;
            }
            if (sqliteService != null)
            {
                try
                {
                    //only for new guid insert new records, for old GUID only update timeOff
                    List <PowerPCSQL> oldpowerpc = await sqliteService.GetWhere <PowerPCSQL>(x => x.GUID.Equals(powerpc.GUID) && x.IsActive);

                    if (oldpowerpc != null && oldpowerpc.Count != 0)
                    {
                        foreach (var ppc in oldpowerpc)
                        {
                            ppc.dateTimeOffPC  = ConverterHelper.ConvertDateTimeToMillisec(powerpc.dateTimeOffPC).ToString();
                            ppc.IsSynchronized = false;
                            result             = await sqliteService.Update(ppc);
                        }
                    }
                    else
                    {
                        result = await sqliteService.Insert(converter.ConvertToPowerPCSQL(powerpc));
                    }
                }
                catch (Exception ex)
                {
                    result = -1;
                    var err = ex.Message;
                    throw ex;
                }
            }
            return(result);
        }
Exemplo n.º 6
0
        public AutoMapperProfile()
        {
            CreateMap <Pizza, PizzaViewModel>();

            CreateMap <Ingredient, IngredientViewModel>();

            CreateMap <PizzaIngredient, IngredientViewModel>().ForMember(i => i.Id, map => map.MapFrom(i => i.Ingredient.Id))
            .ForMember(i => i.Name, map => map.MapFrom(i => i.Ingredient.Name)).ReverseMap();

            CreateMap <Customer, CustomerViewModel>().ForMember(c => c.Password, map => map.Ignore()).ForSourceMember(c => c.PasswordHash, map => map.Ignore()).ReverseMap();

            CreateMap <OrderViewModel, Order>().ConvertUsing(vm => ConverterHelper.ConvertViewModelToOrder(vm));

            CreateMap <Order, OrderViewModel>().ConvertUsing(m => ConverterHelper.ConvertOrderToViewModel(m));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Fill in the list of the chart areas for the series.
        /// </summary>
        /// <param name="context">Descriptor context.</param>
        /// <returns>Standart values collection.</returns>
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            ArrayList values = new ArrayList();

            Chart chart = ConverterHelper.GetChartFromContext(context);

            if (chart != null)
            {
                foreach (ChartArea area in chart.ChartAreas)
                {
                    values.Add(area.Name);
                }
            }
            return(new StandardValuesCollection(values));
        }
Exemplo n.º 8
0
        public void HexStringToByteArrayTest()
        {
            var  one_time_private = ConverterHelper.HexStringToByteArray("5cea26accf0ff2fce735c7e75d3c203213404af600ba848aa42e147f9718c584");
            SHA1 sha      = new SHA1CryptoServiceProvider();
            var  sha1Hash = sha.ComputeHash(one_time_private);

            0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

            //Assert.IsTrue(array.Length == key.Length);

            //for (var i = 0; i < key.Length; i++)
            //{
            //    Assert.IsTrue(array[i] == key[i]);
            //}
        }
Exemplo n.º 9
0
        internal static ShapeStyle ParseString(string s)
        {
            ShapeStyle      style  = null;
            ConverterHelper helper = ConverterHelper.ParseString(s);

            if (helper != null)
            {
                style = new ShapeStyle();
                if (helper.ContainsKey("StrokeThickness"))
                {
                    style.StrokeThickness = double.Parse(helper["StrokeThickness"].ToString(), (IFormatProvider)CultureInfo.InvariantCulture);
                }
            }
            return(style);
        }
Exemplo n.º 10
0
        public void CompressedPubKey(string wif)
        {
            var curv   = new SECP256k1();
            var secret = ConverterHelper.HexStringToByteArray(wif);
            var order  = R;
            var p      = curv * string_to_number(secret);


            //2    p = ecdsa.SigningKey.from_string(secret, curve = ecdsa.SECP256k1).verifying_key.pubkey.point
            //2    x_str = ecdsa.util.number_to_string(p.x(), order)
            //2    y_str = ecdsa.util.number_to_string(p.y(), order)
            //2    compressed = hexlify(bytes(chr(2 + (p.y() & 1)), 'ascii') + x_str).decode('ascii')
            //2    uncompressed = hexlify(bytes(chr(4), 'ascii') + x_str + y_str).decode('ascii')
            //2    return ([compressed, uncompressed])
        }
        protected override UserTrip CreateValueFromReader(IDatabaseReader reader)
        {
            var userTrip = new UserTrip
                           (
                reader.GetInt("USRIDT"),
                reader.GetString("TRPNAM"),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDUSRPAR")),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDUSRORG")),
                reader.GetDouble("USRNOT"),
                reader.GetDouble("TRPMNT")
                           );

            userTrip.ModificationDate = reader.GetDate("DATEFT");
            return(userTrip);
        }
Exemplo n.º 12
0
        public IActionResult SaveOrder([FromBody] OrderViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Validation error!"));
            }

            Order order = ConverterHelper.ConvertViewModelToOrder(model);

            _dataAccess.Orders.Create(order);

            _dataAccess.SaveChanges();

            return(Ok(order.Number));
        }
Exemplo n.º 13
0
        private void SetRegularPropertyValue()
        {
            // we set the value
            var propertyInfo = this.AssociatedObject.GetType().GetProperty(this.PropertyName);

            if (propertyInfo == null || !propertyInfo.CanWrite)
            {
                return;
            }

            // else we convert and set the value
            var value = Value != null?ConverterHelper.ConvertToType(Value, propertyInfo.PropertyType) : null;

            propertyInfo.SetValue(this.AssociatedObject, value, null);
        }
Exemplo n.º 14
0
        /// <inheritdoc/>
        public object GetColumnValue(ColumnInfo columnInfo, T item)
        {
            var value = columnInfo.PropertyInfo.GetValue(item, null);

            if (value != null)
            {
                var converter = ConverterHelper.GetConverter(columnInfo, value.GetType());
                if (converter != null)
                {
                    value = converter.ConvertBack(value);
                }
            }

            return(value);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Function: Convert MessageInfo to ufe.Message
        /// Author  : Jerry Xu
        /// Date    : 2008-12-2
        /// </summary>
        /// <param name="message">MessageInfo</param>
        /// <returns>Message</returns>
        public override FrameObjectType Convert(MessageInfo message)
        {
            Shapes.Clear();

            File          = ConvertFile(message);
            NailImageFile = ConvertNailImage(message);

            FrameObjectType ufeMessage = new FrameObjectType();
            List <ProWrite.UFE.Entity.FrameContentType> layers = new List <ProWrite.UFE.Entity.FrameContentType>();


#if VERSION_1
            ufeMessage.Id     = message.Id;
            ufeMessage.Length = float.Parse(message.Length.ToString());
            ufeMessage.SignBackgroundColor = ConverterHelper.ColorToString(message.BackColor, NumberType.Hex);
            if (message.EmphasisEffect != null && message.EmphasisEffect.Name != null && message.EmphasisEffect.Duration != 0)
            {
                ufeMessage.EmphasisEffect = ConvertEmphasisEffect(message.EmphasisEffect);
            }
#else
            ConvertId(message, ref ufeMessage.ContentID);

            ufeMessage.MasterLayer.Length = float.Parse(message.Length.ToString());
            ufeMessage.MasterLayer.SignBackgroundColor = ConverterHelper.ColorToString(message.ConvertedSignBackColor(Sign.Type), Sign.Type);
            if (message.EmphasisEffect != null && message.EmphasisEffect.Name != null && message.EmphasisEffect.Duration != 0)
            {
                ufeMessage.MasterLayer.EmphasisEffect = ConvertEmphasisEffect(message.EmphasisEffect);
            }
            //if (message.EmphasisEffect != null && message.EmphasisEffect.Name != null && message.EmphasisEffect.Duration != 0)
            //    ufeMessage.MasterLayer.EntryEffect = ConvertEffect(message.EmphasisEffect);
            //if (message.EmphasisEffect != null && message.EmphasisEffect.Name != null && message.EmphasisEffect.Duration != 0)
            //    ufeMessage.MasterLayer.ExitEffect = ConvertEffect(message.EmphasisEffect);
#endif

            if (message.Items != null && message.Items.Length > 0)
            {
                foreach (ShapeLayer layer in message.Items)
                {
                    if (layer.Shape != null)
                    {
                        layers.Add(ConvertLayer(layer));
                    }
                }
                ufeMessage.Contents = layers;
            }

            return(ufeMessage);
        }
Exemplo n.º 16
0
        public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!ConverterHelper.IsValueValid(value))
            {
                return(DependencyProperty.UnsetValue);
            }
            var shortcut  = value[0] as Shortcut;
            var viewModel = value[1] as ViewModel;

            if (viewModel == null || shortcut == null)
            {
                return(DependencyProperty.UnsetValue);
            }

            return(shortcut.GetShortcutIcon(viewModel));
        }
Exemplo n.º 17
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!ConverterHelper.IsValueValid(value))
            {
                return(DependencyProperty.UnsetValue);
            }
            switch ((IconPosition)value)
            {
            default:
            case IconPosition.Left:
                return(Dock.Left);

            case IconPosition.Right:
                return(Dock.Right);
            }
        }
Exemplo n.º 18
0
 private void RefreshView()
 {
     if (Source == null)
     {
         return;
     }
     MicroAgo.Text = ConverterHelper.Ago(Source.CreatedAt);
     if (Source.User != null)
     {
         MicroAvatar.ProfilePicture = ConverterHelper.ToImg(Source.User.Avatar);
         MicroName.Text             = MicroAvatar.DisplayName = Source.User.Name;
     }
     MicroContent.Content = Source.Content;
     MicroContent.Rules   = Source.ExtraRule;
     MicroFile.Items      = Source.Attachment;
 }
Exemplo n.º 19
0
        private static void FromReader(IDataReader reader, ILGenerator ilGenerator, ColumnInfo columnInfo)
        {
            int  ordinal = reader.GetOrdinal(columnInfo.Name);
            Type srcType = reader.GetFieldType(ordinal);

            IConverter converter = ConverterHelper.GetConverter(columnInfo, srcType);

            if (converter is null)
            {
                ilGenerator.EmitFieldWithoutConverter(srcType, columnInfo.PropertyInfo.PropertyType, ordinal);
            }
            else
            {
                ilGenerator.EmitFieldWithConverter(converter, columnInfo.PropertyInfo.PropertyType, ordinal);
            }
        }
Exemplo n.º 20
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!ConverterHelper.IsValueValid(value))
            {
                return(DependencyProperty.UnsetValue);
            }
            var file          = (FileInfo)value;
            var stringBuilder = new StringBuilder();

            stringBuilder.Append(file.FullName);
            if (file.Exists)
            {
                stringBuilder.Append(Environment.NewLine);
                stringBuilder.Append(file.LastWriteTime.ToString(CultureInfo.CurrentCulture));
            }
            return(stringBuilder.ToString());
        }
Exemplo n.º 21
0
        protected override PotUser CreateValueFromReader(IDatabaseReader reader)
        {
            var potUser = new PotUser
                          (
                reader.GetInt("USRIDT"),
                reader.GetInt("POTIDT"),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDPAY")),
                reader.GetDouble("CURMNT"),
                reader.GetDouble("TGTMNT"),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDCANCEL")),
                reader.GetString("CANCELRSN"),
                ConverterHelper.YesNoStringToBool(reader.GetString("INDVAL"))
                          );

            potUser.ModificationDate = reader.GetDate("DATEFT");
            return(potUser);
        }
Exemplo n.º 22
0
        public static object NewInstance(INode iNode, Meta meta)
        {
            var instance = Activator.CreateInstance(meta.RawType);

            meta.SetId(instance, iNode.Id);

            foreach (var prop in meta.RegularProperties)
            {
                if (iNode.Properties.TryGetValue(prop.GetName(), out var neoVal))
                {
                    var objectValue = ConverterHelper.ToObjectValue(neoVal, prop.Info.PropertyType);
                    prop.SetValue(instance, objectValue);
                }
            }

            return(instance);
        }
Exemplo n.º 23
0
        private void ChekinUpdate(Checkin checkin)
        {
            if (checkin == null)
            {
                Clear();
                return;
            }
            CheckinHeader = GetCheckinHeader(checkin.CreatedDate);
            CheckinUrl    = checkin.Url;
            if (checkin.RatingScore.HasValue)
            {
                VisibilityCheckinRating = true;
                CheckinRating           = checkin.RatingScore.Value;
            }
            else
            {
                CheckinRating           = 0;
                VisibilityCheckinRating = false;
            }
            CheckinVenueName               = checkin.Venue.Name;
            CheckinVenueCountry            = checkin.Venue.Country;
            CheckinVenueState              = checkin.Venue.State;
            CheckinVenueCity               = checkin.Venue.City;
            VisibilityCheckinVenueLocation = checkin.Venue.Latitude.HasValue && checkin.Venue.Longitude.HasValue;
            CheckinServingType             = ConverterHelper.GetServingTypeImagePath(checkin.ServingType);
            UpdateCheckinPhoto(checkin);
            UpdateBadges(checkin.Badges);

            BeerUrl         = checkin.Beer.Url;
            BeerName        = checkin.Beer.Name;
            BeerType        = checkin.Beer.Type;
            BeerABV         = checkin.Beer.ABV.ToString();
            BeerIBU         = GetBeerIBU(checkin.Beer.IBU);
            BeerRating      = checkin.Beer.GlobalRatingScore;
            BeerDescription = GetBeerDescription(checkin.Beer.Description);
            UpdateBeerLabel(checkin.Beer);

            BreweryUrl          = checkin.Beer.Brewery.Url;
            BreweryName         = checkin.Beer.Brewery.Name;
            BreweryVenueName    = checkin.Beer.Brewery.Venue.Name;
            BreweryVenueCountry = checkin.Beer.Brewery.Venue.Country;
            BreweryVenueState   = checkin.Beer.Brewery.Venue.State;
            BreweryVenueCity    = checkin.Beer.Brewery.Venue.City;
            UpdateBreweryLabel(checkin.Beer.Brewery);
        }
Exemplo n.º 24
0
        public VTSModel ConvertToVTSModel(VacationInfoModel vacationInfo)
        {
            VTSModel vtsModel = new VTSModel();

            vtsModel.Id = vacationInfo.Id;
            if (vacationInfo.Type.Value != null)
            {
                vtsModel.VacationType = vacationInfo.Type.Value;
            }
            vtsModel.StartDate = vacationInfo.StartDate;
            vtsModel.EndDate   = vacationInfo.EndDate;
            var startDate  = LocalizeMonth((new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddMilliseconds(vacationInfo.StartDate).ToLocalTime().ToString("MMM dd, yyyy"));
            var endDate    = LocalizeMonth((new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddMilliseconds(vacationInfo.EndDate).ToLocalTime().ToString("MMM dd, yyyy"));
            var _startDate = ConverterHelper.ConvertMillisecToDateTime(vacationInfo.StartDate);
            var _endDate   = ConverterHelper.ConvertMillisecToDateTime(vacationInfo.EndDate);
            var dayCount   = ConverterHelper.CalculateDuration(_startDate, _endDate);
            var days       = string.Empty;

            if (dayCount == 1)
            {
                days = _localizer.Localize("day");
            }
            else
            {
                if (dayCount > 1 && dayCount < 5)
                {
                    days = _localizer.Localize("day24");
                }
                else
                {
                    days = _localizer.Localize("days");
                }
            }
            vtsModel.Date = startDate + " - " + endDate + " (" + dayCount + " " + days + ")";
            if (vacationInfo.Status != null)
            {
                vtsModel.Status = vacationInfo.Status.Value;
            }

            if (vacationInfo.Type.Value != null)
            {
                vtsModel.VacationType = vacationInfo.Type.Value;
            }
            return(vtsModel);
        }
Exemplo n.º 25
0
        internal static CommunityRefineVm MapToCommunityRefineVm(this CommunitiesSearchVm searchVm)
        {
            long?nullable;
            long?nullable1;
            long?nullable2;
            CommunityRefineVm communityRefineVm = new CommunityRefineVm();
            List <KeyValuePair <int, string> > communityDefaultAmenities = ItemTypeBc.Instance.GetCommunityDefaultAmenities();
            List <KeyValuePair <int, string> > shcCategoriesForCommunity = ItemTypeBc.Instance.GetShcCategoriesForCommunity();
            List <KeyValuePair <int, string> > list          = ItemTypeBc.Instance.GetBedrooms().Take <KeyValuePair <int, string> >(6).ToList <KeyValuePair <int, string> >();
            List <KeyValuePair <int, string> > keyValuePairs = (
                from pair in ItemTypeBc.Instance.GetBathrooms()
                where !pair.Value.Contains(".")
                select pair).Take <KeyValuePair <int, string> >(6).ToList <KeyValuePair <int, string> >();

            communityRefineVm.Amenities     = communityDefaultAmenities.MapToSelectListItemList(searchVm.Amenities);
            communityRefineVm.ShcCategories = shcCategoriesForCommunity.MapToSelectListItemList(searchVm.ShcCategories);
            List <KeyValuePair <int, string> > keyValuePairs1 = keyValuePairs;
            int?bathes = searchVm.Bathes;

            if (bathes.HasValue)
            {
                nullable1 = new long?((long)bathes.GetValueOrDefault());
            }
            else
            {
                nullable  = null;
                nullable1 = nullable;
            }
            communityRefineVm.Bathes = keyValuePairs1.ToSelectListItemList(nullable1);
            List <KeyValuePair <int, string> > keyValuePairs2 = list;

            bathes = searchVm.Beds;
            if (bathes.HasValue)
            {
                nullable2 = new long?((long)bathes.GetValueOrDefault());
            }
            else
            {
                nullable  = null;
                nullable2 = nullable;
            }
            communityRefineVm.Beds      = keyValuePairs2.ToSelectListItemList(nullable2);
            communityRefineVm.SortTypes = ConverterHelper.EnumToKoSelectListItems <CommunitySortType>(searchVm.SortType);
            return(communityRefineVm);
        }
Exemplo n.º 26
0
        private static void FromReader(IDataReader reader, ILGenerator iLGenerator, ColumnInfo columnInfo)
        {
            string fieldName = columnInfo.Name;
            int    ordinal   = reader.GetOrdinal(fieldName);

            Type srcType = reader.GetFieldType(ordinal);

            IConverter converter = ConverterHelper.GetConverter(columnInfo, srcType);

            if (converter is null)
            {
                iLGenerator.CallReaderGetValueWithoutConverter(ordinal, columnInfo, srcType);
            }
            else
            {
                iLGenerator.CallReaderGetValueWithConverter(ordinal, converter, columnInfo);
            }
        }
Exemplo n.º 27
0
        private async void OnUploadPhotoClick(object sender, EventArgs e)
        {
            var userViewModel = (EmployerViewModel)BindingContext;

            var button = (Button)sender;

            button.IsEnabled = false;
            var    picturePicker = DependencyService.Get <IPicturePicker>();
            Stream stream        = await picturePicker.GetImageStreamAsync();

            if (stream != null)
            {
                var bytes = ConverterHelper.ReadFully(stream);
                userViewModel.Photo = ImageSource.FromStream(() => new MemoryStream(bytes));
            }

            button.IsEnabled = true;
        }
Exemplo n.º 28
0
        /// <summary>
        ///     分页查询:1.条件表达式;2.分页索引;3.分页大小;4.排序字段
        /// </summary>
        /// <param name="whereExpression">条件表达式</param>
        /// <param name="intPageIndex">分页索引</param>
        /// <param name="intPageSize">分页大小</param>
        /// <param name="strOrderByFields">排序字段</param>
        /// <returns></returns>
        public virtual async Task <PageResult <T> > QueryPage(Expression <Func <T, bool> > whereExpression, int intPageIndex = 1,
                                                              int intPageSize = 20, string strOrderByFields = null)
        {
            RefAsync <int> totalCount = 0;
            List <T>       list       = await this.SugarClient.Queryable <T>()
                                        .OrderByIF(!string.IsNullOrEmpty(strOrderByFields), strOrderByFields)
                                        .WhereIF(whereExpression != null, whereExpression)
                                        .ToPageListAsync(intPageIndex, intPageSize, totalCount);

            int pageCount = ConverterHelper.ObjToInt(
                Math.Ceiling(ConverterHelper.ObjToDecimal(totalCount) / ConverterHelper.ObjToDecimal(intPageSize)));

            return(new PageResult <T>
            {
                TotalCount = totalCount, TotalPages = pageCount, PageIndex = intPageIndex, PageSize = intPageSize,
                Data = list
            });
        }
Exemplo n.º 29
0
        private void ProxyOnOnPropertyChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (SourceProperty != null && Context != null)
            {
                object value = e.NewValue;
                if (Expression.Converter != null)
                {
                    value = Expression.Converter.ConvertBack(value, SourceProperty.PropertyType, Expression.ConverterParameter, CultureInfo.CurrentUICulture);
                }

                value = ConverterHelper.ChangeType(value, SourceProperty.PropertyType);

                if (SourceProperty.CanWrite)
                {
                    SourceProperty.SetValue(Context, value);
                }
            }
        }
        public ActionResult Editar(ProdutoModel item, FormCollection form)
        {
            Guid categoriaId;
            Guid modeloId;

            if (Guid.TryParse(form["Categorias"], out categoriaId))
            {
                item.CategoriaID = categoriaId;
            }

            if (Guid.TryParse(form["Modelos"], out modeloId))
            {
                item.ModeloID = modeloId;
            }

            ContextHelper.AlterarProduto(ConverterHelper <ProdutoModel, Produto> .ConvertAParaB(item));
            return(RedirectToAction("Index"));
        }