コード例 #1
0
        public StarSignDto GetByCode(int code)
        {
            StarSignDto dto    = new StarSignDto();
            var         entity = repository.Collect(p => p.Code == code).FirstOrDefault();

            if (entity != null)
            {
                return(dto.ToObject(entity));
            }
            return(null);
        }
コード例 #2
0
ファイル: Common.cs プロジェクト: ajaybhasyexp/Sreekovil
        public static void FillStarSign(ComboBox cmb)
        {
            StarSignViewModel viewModel = new StarSignViewModel();

            cmb.DisplayMember = "StarSignName";
            cmb.ValueMember   = "StarSignId";
            var         entities = viewModel.GetAllStarSigns().ToList();
            StarSignDto dto      = new StarSignDto()
            {
                Code         = 0,
                StarSignId   = 0,
                StarSignName = "തിരഞ്ഞെടുക്കുക"
            };

            entities.Add(dto);
            cmb.DataSource    = entities;
            cmb.SelectedValue = 0;
        }
コード例 #3
0
        public IEnumerable <StarSignDto> GetAllStarSigns()
        {
            StarSignDto dto = new StarSignDto();

            return(dto.ToObjects(repository.GetAll()));
        }