Esempio n. 1
0
        public Item addEntry(int id, EntryDTO entryDTO)
        {
            var item = this._context.Items.Find(id);

            if (item == null)
            {
                return(null);
            }
            item.Quantity = item.Quantity + entryDTO.Quantity;
            this._context.SaveChanges();
            return(item);
        }
Esempio n. 2
0
 public static List <string> GetNounDefinitions(this EntryDTO entry)
 {
     return(entry.Results
            .SelectMany(r => r.LexicalEntries).Where(lex => lex.LexicalCategory == "Noun")
            .Where(lex => lex.Entries != null)
            .SelectMany(lex => lex.Entries)
            .Where(e => e.Senses != null)
            .SelectMany(e => e.Senses)
            .Where(s => s.Definitions != null)
            .SelectMany(s => s.Definitions)
            .ToList());
 }
Esempio n. 3
0
        public HttpResponseMessage Get(int ID)
        {
            EntryDTO entry = dao.getEntry(ID);

            if (entry != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, entry));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
        }
Esempio n. 4
0
        public bool EditContact(EntryDTO existingEntry)
        {
            try
            {
                return(_phoneService.EditContact(existingEntry));
            }
            catch (Exception ex)
            {
                _logger.LogError($"Exception occurred while editing contact. entryId: {existingEntry.Id}, stackTrace: {ex.ToString()}");

                return(false);
            }
        }
Esempio n. 5
0
        public bool CreateContact(EntryDTO newEntry, int phonebookId)
        {
            try
            {
                return(_phoneService.CreateContact(newEntry, phonebookId));
            }
            catch (Exception ex)
            {
                _logger.LogError($"Exception occurred while creating contact. phonebookId: {phonebookId}, stackTrace: {ex.ToString()}");

                return(false);
            }
        }
Esempio n. 6
0
        public HttpResponseMessage Put([FromBody] EntryDTO entry)
        {
            var result = dao.editEntry(entry);

            if (result != -999999)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, "/api/Entry/" + entry.Id));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, "Error when editing entry"));
            }
        }
Esempio n. 7
0
        public static IEntry MappFrom(EntryDTO entry)
        {
            EntryModel entryModel = new EntryModel();

            SetCommonDboProperties(entryModel, entry);
            entryModel.EntryNo          = entry.EntryNo;
            entryModel.EntryName        = entry.EntryName;
            entryModel.RegistrationDate = entry.RegistrationDate;
            entryModel.PaidAmount       = entry.PaidAmount;
            entryModel.Boat             = MappFrom(entry.Boat);
            entryModel.Club             = MappFrom(entry.Club);
            entryModel.User             = MappFrom(entry.User);
            return(entryModel);
        }
Esempio n. 8
0
        internal int editEntry(EntryDTO alteredEntry)
        {
            var context = new rulesencyclopediaDBEntities1();
            int result  = -999999;

            {
                var entry = context.Entry.First(a => a.Id == alteredEntry.Id);
                entry.ParagraphNumber = alteredEntry.ParagraphNumber;
                entry.Headline        = alteredEntry.Headline;
                entry.Text            = alteredEntry.Text;
                entry.Revision        = alteredEntry.Revision;
                entry.Editor          = alteredEntry.Editor;
                result = context.SaveChanges();
            }
            context.Dispose();
            return(result);
        }
Esempio n. 9
0
        public async Task <ResponceModel> Update([FromRoute] int id, [FromBody] EntryDTO model)
        {
            var identifier = User.Claims.FirstOrDefault(p => p.Type == "id");

            if (identifier == null)
            {
                return(new ResponceModel(401, "FAILED", null, new string[] { "Yetkilendirme Hatası." }));
            }
            if (id == 0)
            {
                return(new ResponceModel(404, "FAILD", null, new string[] { "Güncellenecek veri bulunamadı." }));
            }
            try
            {
                var user  = (await _userService.GetById(int.Parse(identifier.Value)));
                var entry = await _entryService.Get(id);

                if (entry == null)
                {
                    return(new ResponceModel(404, "FAILD", null, new string[] { "Güncellenecek veri bulunamadı." }));
                }
                if (user.Id != entry.UserId)
                {
                    return(new ResponceModel(401, "FAILED", null, new string[] { "Yetkilendirme Hatası." }));
                }
                entry = model.Adapt <Entry>();
                _entryService.Update(entry);
                if (await _entryService.SaveChangesAsync())
                {
                    return(new ResponceModel(200, "OK", entry, null));
                }
                else
                {
                    return(new ResponceModel(400, "FAILD", null, new string[] { "Veri güncellenirken bir sorun oluştu." }));
                }
            }
            catch (Exception ex)
            {
                await _logService.Add(new SystemLog()
                {
                    Content = ex.Message, CreateDate = DateTime.Now, UserId = 0, EntityName = _entryService.GetType().Name
                });

                return(new ResponceModel(500, "ERROR", null, new string[] { "Veri güncellenirken bir sorun oluştu." }));
            }
        }
Esempio n. 10
0
        public async Task <ActionResult <EntryDTO> > PostEntry([FromBody] EntryDTO dto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var entry = EntryMapper.Map(dto, new Entry());

            Console.WriteLine(entry.EntryId);

            _context.Entries.Add(entry);
            await _context.SaveChangesAsync();

            Console.WriteLine(entry.EntryId);

            return(CreatedAtAction("GetEntry", new { id = entry.EntryId }, entry));
        }
        private static async Task <EntryDTO> GetEntryData(HttpRequest req)
        {
            string  requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            dynamic rawData     = JsonConvert.DeserializeObject(requestBody);

            if (rawData == null)
            {
                return(null);
            }

            var data = new EntryDTO
            {
                CompetitionId = rawData?.CompetitionId ?? CompetitionId.New,
                Discipline    = rawData?.Discipline,
                Name          = rawData?.Name,
                TimeInMillis  = rawData?.TimeInMillis ?? -1
            };

            return(data);
        }
        public async Task <IActionResult> Post(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = "entry")] HttpRequest req,
            ILogger log)
        {
            EntryDTO data = await GetEntryData(req);

            if (data == null)
            {
                return(new BadRequestObjectResult("Must provide Entry details in POST body."));
            }

            var competitionId = CompetitionId.With(data.CompetitionId);
            var entryId       = EntryId.New;

            RecordEntryCommand recordEntryCommand = new RecordEntryCommand(competitionId, entryId, data.Discipline, data.Name, data.TimeInMillis);
            var result = await _eventFlow.PublishAsync(recordEntryCommand, CancellationToken.None);

            return(result?.IsSuccess == true
                ? (ActionResult) new OkObjectResult($"{recordEntryCommand.EntryId}")
                : new BadRequestObjectResult("Cannot create new entry"));
        }
        public async Task <IActionResult> Put(
            [HttpTrigger(AuthorizationLevel.Function, "put", Route = "entry/{id}")] HttpRequest req,
            ILogger log, string id)
        {
            EntryDTO data = await GetEntryData(req);

            if (data == null)
            {
                return(new BadRequestObjectResult("Must provide Entry details in POST body."));
            }

            var competitionId = CompetitionId.With(data.CompetitionId);
            var entryId       = EntryId.With(id);

            CorrectEntryTimeCommand correctEntryTimeCommand = new CorrectEntryTimeCommand(competitionId, entryId, data.TimeInMillis);
            var result = await _eventFlow.PublishAsync(correctEntryTimeCommand, CancellationToken.None);

            return(result?.IsSuccess == true
                ? (ActionResult) new OkObjectResult($"{JsonConvert.SerializeObject(correctEntryTimeCommand)}")
                : new BadRequestObjectResult($"Cannot or did not update entry {id}"));
        }
Esempio n. 14
0
        public static async void AnalyseWord()
        {
            string initialWord = "matter";

            Stopwatch sw = new Stopwatch();

            sw.Start();
            // Get initial entry
            EntryDTO entry = await APIManager.GetWordEntry(initialWord);

            WordNode      root   = new WordNode(entry);
            List <string> tested = new List <string> {
                initialWord
            };

            GetWordTree(root);
            var a = root.Traverse().Select(n => n.Entry.Word);

            sw.Stop();
            var time = sw.Elapsed;
        }
Esempio n. 15
0
        public static IEnumerable <EntryDTO> GetEntries()
        {
            var current = new EntryDTO();
            var entries = new List <EntryDTO>()
            {
                current
            };

            foreach (var line in Input.Lines)
            {
                if (string.IsNullOrWhiteSpace(line))
                {
                    current = new EntryDTO();
                    entries.Add(current);
                    continue;
                }

                current.ReadLine(line);
            }

            return(entries);
        }
Esempio n. 16
0
        /**
         *  Returns the associated lemmatized noun EntryDTO of the initial entry, or Null if it has no such association.
         */
        private static async Task <EntryDTO> GetNounEntry(this EntryDTO entry, List <string> probableNouns)
        {
            if (entry == null)
            {
                return(null);
            }

            var entryLex = entry.GetLexicalEntries();

            if (entryLex == null)
            {
                return(null);
            }

            var entryLexNouns = entryLex.Where(lex => lex.LexicalCategory == "Noun");

            /*
             *  If either of the following conditions are met, it is probably noun:
             *      - There are lexical entries with the Noun category AND the semantical analysis tagged it as a noun.
             *      - The only lexical entries of this word are in the Noun category.
             */
            if ((entryLexNouns.Any() && probableNouns.Contains(entry.Word)) || entryLex.Count() == entryLexNouns.Count())
            {
                // If it has inflections, it's a lemma
                var inflections = entryLexNouns.Where(lex => lex.InflectionOf != null).SelectMany(lex => lex.InflectionOf).ToList();
                if (inflections.Any())
                {
                    // Return the full EntryDTO for the lemma
                    return(await GetWordEntry(inflections.First().Id));
                }
                else
                {
                    // Return the initial entry, since it's probably a root noun already
                    return(entry);
                }
            }
            return(null);
        }
Esempio n. 17
0
        private EntryDTO ToDTO(EntryEntity entity)
        {
            EntryDTO dto = new EntryDTO();

            dto.Address        = entity.Address;
            dto.BankAccount    = entity.BankAccount;
            dto.CityId         = entity.CityId;
            dto.Contact        = entity.Contact;
            dto.CreateDateTime = entity.CreateDateTime;
            dto.Duty           = entity.Duty;
            dto.Ein            = entity.Ein;
            dto.EntryChannelId = entity.EntryChannelId;
            dto.Gender         = entity.Gender;
            dto.Id             = entity.Id;
            dto.InvoiceUp      = entity.InvoiceUp;
            dto.Mobile         = entity.Mobile;
            dto.Name           = entity.Name;
            dto.OpenBank       = entity.OpenBank;
            dto.PayId          = entity.PayId;
            dto.StayId         = entity.StayId;
            dto.WorkUnits      = entity.WorkUnits;
            return(dto);
        }
Esempio n. 18
0
 public ActionResult Create(EntryCreateViewModel entryCreateViewModel)
 {
     try
     {
         EntryDTO entryDto = new EntryDTO(entryCreateViewModel.EntryNo, entryCreateViewModel.EntryName, DateTime.Now, 0, entryCreateViewModel.BoatId, entryCreateViewModel.RegattaId, entryCreateViewModel.ClubRepresentationId);
         UserDTO  user;
         using (var userService = new UserService())
         {
             var loginUser = Session["Login"].ToString();
             user = userService.EagerDisconnectedService.FindBy(u => u.Login == loginUser).First();
         }
         using (var entryService = new EntryService())
         {
             entryService.EagerDisconnectedService.Add(user, entryDto);
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         TempData["ResultMessage"] = e.Message;
         return(View("Error"));
     }
 }
Esempio n. 19
0
        internal EntryDTO getEntry(int ID)
        {
            Entry    entry    = null;
            EntryDTO entryDTO = null;
            rulesencyclopediaDBEntities1 context = null;

            try
            {
                context = new rulesencyclopediaDBEntities1();
                {
                    entry    = context.Entry.Single(element => element.Id == ID);
                    entryDTO = (EntryDTO)DTOConverter.Converter(new EntryDTO(), entry);
                }
            }
            catch (EntityException ex)
            {
                exHandler.exceptionHandlerEntity(ex, "something went wrong when getting the Entry");
            }
            finally
            {
                context.Dispose();
            }
            return(entryDTO);
        }
Esempio n. 20
0
        public async Task <IActionResult> PutEntry([FromRoute] int id, [FromBody] EntryDTO dto)
        {
            Console.WriteLine("I shouldn't be here!");

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != dto.EntryId)
            {
                return(BadRequest());
            }

            var entry = EntryMapper.Map(dto, new Entry());

            _context.Entry(entry).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EntryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 21
0
        public async static Task <EntryDTO> GetLemmaEntry(string word, string lang = LANG)
        {
            using (var response = await CustomHttpClient.Client()
                                  .GetAsync(@"inflections/" + lang + "/" + word)
                                  .ConfigureAwait(false))
            {
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    using (var content = response.Content)
                    {
                        string rawcontent = await content.ReadAsStringAsync();

                        JObject  json  = JObject.Parse(rawcontent);
                        EntryDTO entry = JsonConvert.DeserializeObject <EntryDTO>(rawcontent);
                        entry.Word = word;
                        return(entry);
                    }
                }
                else
                {
                    return(null);
                }
            }
        }
Esempio n. 22
0
        public static List <string> GetFirstEntryDefinitions(this EntryDTO entry)
        {
            List <Result> results = entry.Results;

            if (results.Any())
            {
                List <LexicalEntry> lexicalEntries = results.First().LexicalEntries;
                if (lexicalEntries.Any())
                {
                    List <Entry> entries = lexicalEntries.First().Entries;
                    if (entries.Any())
                    {
                        List <Sense> senses = entries.First().Senses;
                        if (senses.Any())
                        {
                            List <string> definitions = senses.First().Definitions;
                            return(definitions);
                        }
                    }
                }
            }

            return(new List <string>());
        }
Esempio n. 23
0
        public ActionResult CheckJoinin(JoininModel model)
        {
            #region 数据验证
            if (model.TrainId <= 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "未知培训"
                }));
            }
            TrainDTO train = trainService.GetById(model.TrainId);
            if (train == null)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "未知培训"
                }));
            }
            if (train.StatusName == "已结束")
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "活动已结束"
                }));
            }
            if (train.UpToOne != 0)
            {
                if (train.EntryCount >= train.UpToOne)
                {
                    return(Json(new AjaxResult {
                        Status = "0", ErrorMsg = "报名人数已满"
                    }));
                }
            }
            if (string.IsNullOrEmpty(model.Name))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "姓名不能为空"
                }));
            }
            if (model.Gender == 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择性别"
                }));
            }
            if (string.IsNullOrEmpty(model.Mobile))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "手机号不能为空"
                }));
            }

            long phoneNum;
            if (!long.TryParse(model.Mobile, out phoneNum))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "手机号必须是数字"
                }));
            }
            if (model.Mobile.Length != 11)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "手机号必须是11位数字"
                }));
            }
            if (entryService.IsJoinined(model.TrainId, model.Mobile))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "该手机号已报过名"
                }));
            }
            if (string.IsNullOrEmpty(model.WorkUnits))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "工作单位不能为空"
                }));
            }
            if (string.IsNullOrEmpty(model.Duty))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "职务不能为空"
                }));
            }
            if (model.CityId == 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择工作地"
                }));
            }
            if (model.StayId == 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择住宿"
                }));
            }
            if (model.PayId == 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择支付方式"
                }));
            }
            //if (string.IsNullOrEmpty(model.InvoiceUp))
            //{
            //    return Json(new AjaxResult { Status = "0", ErrorMsg = "发票不能为空" });
            //}
            //if (string.IsNullOrEmpty(model.Ein))
            //{
            //    return Json(new AjaxResult { Status = "0", ErrorMsg = "税号不能为空" });
            //}
            //if (string.IsNullOrEmpty(model.Address))
            //{
            //    return Json(new AjaxResult { Status = "0", ErrorMsg = "详细地址不能为空" });
            //}
            //if (string.IsNullOrEmpty(model.Contact))
            //{
            //    return Json(new AjaxResult { Status = "0", ErrorMsg = "联系方式不能为空" });
            //}
            //if (string.IsNullOrEmpty(model.OpenBank))
            //{
            //    return Json(new AjaxResult { Status = "0", ErrorMsg = "开户行不能为空" });
            //}
            //if (string.IsNullOrEmpty(model.BankAccount))
            //{
            //    return Json(new AjaxResult { Status = "0", ErrorMsg = "银行账号不能为空" });
            //}
            #endregion

            #region 报名添加数据
            EntryDTO dto = new EntryDTO();
            dto.Address        = model.Address;
            dto.BankAccount    = model.BankAccount;
            dto.CityId         = model.CityId;
            dto.Contact        = model.Contact;
            dto.Duty           = model.Duty;
            dto.Ein            = model.Ein;
            dto.EntryChannelId = 37;//微信公众号id=37,后台录入id=38
            dto.Gender         = model.Gender == 1;
            dto.InvoiceUp      = model.InvoiceUp;
            dto.Mobile         = model.Mobile;
            dto.Name           = model.Name;
            dto.OpenBank       = model.OpenBank;
            dto.PayId          = model.PayId;
            dto.StayId         = model.StayId;
            dto.TrainId        = model.TrainId;
            dto.WorkUnits      = model.WorkUnits;
            long id = entryService.Add(dto);
            if (id > 0)
            {
                return(Json(new AjaxResult {
                    Status = "1", Data = "/train/joinininfo?id=" + id + "&trainId=" + model.TrainId
                }));
            }
            else
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "报名失败"
                }));
            }
            #endregion
        }
Esempio n. 24
0
 public bool EditContact(EntryDTO existingEntry)
 {
     return(_phoneRepository.EditContact(_mapper.Map <Entry>(existingEntry)));
 }
Esempio n. 25
0
 public bool CreateContact(EntryDTO newEntry, int phonebookId)
 {
     return(_phoneRepository.CreateContact(_mapper.Map <Entry>(newEntry), phonebookId));
 }
Esempio n. 26
0
        public ActionResult EntryEdit(EntryEditModel model)
        {
            #region 数据验证
            if (model.Id <= 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "报名用户不存在"
                }));
            }
            if (model.TrainId <= 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "未知培训"
                }));
            }
            TrainDTO train = trainService.GetById(model.TrainId);
            if (train == null)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "未知培训"
                }));
            }
            if (string.IsNullOrEmpty(model.Name))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "姓名不能为空"
                }));
            }
            if (model.Gender == null)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择性别"
                }));
            }
            if (string.IsNullOrEmpty(model.Mobile))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "手机号不能为空"
                }));
            }

            long phoneNum;
            if (!long.TryParse(model.Mobile, out phoneNum))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "手机号必须是数字"
                }));
            }
            if (model.Mobile.Length != 11)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "手机号必须是11位数字"
                }));
            }
            //if (entryService.IsJoinined(model.TrainId, model.Mobile))
            //{
            //    return Json(new AjaxResult { Status = "0", ErrorMsg = "该手机号已报过名" });
            //}
            if (model.CityId == 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择工作地"
                }));
            }
            if (string.IsNullOrEmpty(model.WorkUnits))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "工作单位不能为空"
                }));
            }
            if (string.IsNullOrEmpty(model.Duty))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "职务不能为空"
                }));
            }
            if (model.StayId == 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择住宿"
                }));
            }
            if (model.PayId == 0)
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "请选择支付方式"
                }));
            }
            if (string.IsNullOrEmpty(model.InvoiceUp))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "发票不能为空"
                }));
            }
            if (string.IsNullOrEmpty(model.Ein))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "税号不能为空"
                }));
            }
            if (string.IsNullOrEmpty(model.Address))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "详细地址不能为空"
                }));
            }
            if (string.IsNullOrEmpty(model.Contact))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "联系方式不能为空"
                }));
            }
            if (string.IsNullOrEmpty(model.OpenBank))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "开户行不能为空"
                }));
            }
            if (string.IsNullOrEmpty(model.BankAccount))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "银行账号不能为空"
                }));
            }
            #endregion

            EntryDTO dto = new EntryDTO();
            dto.Id          = model.Id;
            dto.Address     = model.Address;
            dto.BankAccount = model.BankAccount;
            dto.CityId      = model.CityId;
            dto.Contact     = model.Contact;
            dto.Duty        = model.Duty;
            dto.Ein         = model.Ein;
            dto.Gender      = (bool)model.Gender;
            dto.InvoiceUp   = model.InvoiceUp;
            dto.Mobile      = model.Mobile;
            dto.Name        = model.Name;
            dto.OpenBank    = model.OpenBank;
            dto.PayId       = model.PayId;
            dto.StayId      = model.StayId;
            dto.WorkUnits   = model.WorkUnits;
            if (!entryService.Update(dto))
            {
                return(Json(new AjaxResult {
                    Status = "0", ErrorMsg = "编辑报名用户失败"
                }));
            }
            return(Json(new AjaxResult {
                Status = "1", Data = "/train/entrylist?id=" + model.TrainId
            }));
        }
Esempio n. 27
0
 public bool CreateContact(EntryDTO newEntry, int phonebookId)
 {
     return(_phoneService.CreateContact(newEntry, phonebookId));
 }
        public async Task <EntryDTO> AddPreviewEntry(EntryDTO previewEntry)
        {
            var result = await _entriesRepository.AddPreviewEntry(previewEntry);

            return(result);
        }
Esempio n. 29
0
 public bool EditContact(EntryDTO existingEntry)
 {
     return(_phoneService.EditContact(existingEntry));
 }
        public async Task <EntryDTO> AddEntryToTablet([FromUri] string tabletId, [FromBody] EntryDTO previewEntry)
        {
            var result = await _entriesRepository.AddEntryToTablet(await UserId, tabletId, previewEntry);

            return(result);
        }