Example #1
0
        public static void Map(Setting src, SettingModel dest)
        {
            if (src == null || dest == null)
            {
                return;
            }

            //dest.Id = src.Id;
            //dest.Key = src.Key;
            //dest.Name = src.Name;
            dest.CopyPropertyValues(src);
            dest.Type = (LookUps.SettingsTypes)src.Type;

            dest.DisplayValue = src.Value;
            switch ((LookUps.SettingsTypes)src.Type)
            {
            case LookUps.SettingsTypes.Bool: dest.DisplayValue = src.Value.ToLower() == "true" ? Resources.Yes : Resources.No;
                dest.BoolValue = Convert.ToBoolean(src.Value); break;

            case LookUps.SettingsTypes.Int:  dest.IntValue = Convert.ToInt32(src.Value); break;
                //to get diplay from other tables if it was selet or multi selcet
            }
        }