Exemple #1
0
        public void UpdateLabel(int ID, [FromBody] LabelTbl label)
        {
            LabelTbl note = _context.tblLabel.Where <LabelTbl>(t => t.ID == ID).First();

            note.Label = label.Label;
            int result = 0;

            try
            {
                result = _context.SaveChanges();
            }
            catch (Exception e)
            {
                e.ToString();
            }
        }
Exemple #2
0
        public int AddLabel([FromBody] LabelTbl label)
        {
            var labelData = new LabelTbl
            {
                Email = label.Email,
                Label = label.Label
            };
            int result = 0;

            try
            {
                _context.tblLabel.Add(labelData);
                result = _context.SaveChanges();
            }
            catch (Exception e)
            {
                e.ToString();
            }
            return(result);
        }