public Token Get(string id, string password)
        {
            Userdtl   obj  = _repository.UserLogin(id, password);
            MentorDtl obj1 = _repository.MentorLogin(id, password);

            if (obj != null)
            {
                return(new Token()
                {
                    message = "User", token = GetToken(), username = obj.UserName, active = obj.Active, useid = obj.UserId
                });
            }
            else if (obj1 != null)
            {
                return(new Token()
                {
                    message = "Mentor", token = GetToken(), username = obj1.MentorName, active = obj1.Active, useid = obj1.MentorId
                });
            }
            else if (id == "Admin" && password == "Admin")
            {
                return(new Token()
                {
                    message = "Admin", token = GetToken(), username = "******"
                });
            }
            else
            {
                return(new Token()
                {
                    message = "Invalid User", token = ""
                });
            }
        }
 public void Add(MentorDtl item)
 {
     try
     {
         _context.MentorDtls.Add(item);
         _context.SaveChanges();
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #3
0
 public void Put(string id, [FromBody] MentorDtl item)
 {
     _repository.Update(item);
 }
Beispiel #4
0
 public IActionResult Post(MentorDtl item)
 {
     _repository.Add(item);
     return(Ok("Record Added"));
 }
Beispiel #5
0
        public MentorDtl SelectMentor(long MentorId)
        {
            MentorDtl mentor = new MentorDtl();

            return(mentor);
        }
 public void Update(MentorDtl item)
 {
     _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     _context.SaveChanges();
 }
Beispiel #7
0
        public MentorDtl ViewProfile(long MentorId)
        {
            MentorDtl mentor = new MentorDtl();

            return(mentor);
        }
Beispiel #8
0
        public MentorDtl ViewMentor(long Id)
        {
            MentorDtl mentordetails = new MentorDtl();

            return(mentordetails);
        }
 public void Add(MentorDtl item)
 {
     _context.MentorDtls.Add(item);
     _context.SaveChanges();
 }