Example #1
0
        public int add(LOGIN login)
        {
            var result = 0;

            try
            {
                context.LOGIN.Add(login);
                result = context.SaveChanges();
            }
            catch
            {
                result = -1;
            }
            return(result);
        }
Example #2
0
        public int edit(int id, LOGIN login)
        {
            var result = 0;

            try
            {
                var exsitinglogin = context.LOGIN.Find(id);
                exsitinglogin.PASSWORD = login.PASSWORD;
                exsitinglogin.USERNAME = login.USERNAME;

                result = context.SaveChanges();
            }
            catch
            {
                result = -1;
            }

            return(result);
        }