Esempio n. 1
0
        public ApiResponse Login(string UserName, string Password)
        {
            RepoDemo.MeetingDemoEntities DB = new RepoDemo.MeetingDemoEntities();
            var Obj = DB.Usp_Login(UserName, Password).ToList <Usp_Login_Result>().FirstOrDefault();

            if (Obj.Status == 0)
            {
                return new ApiResponse {
                           Status = "Invalid", Message = "Invalid User."
                }
            }
            ;
            if (Obj.Status == -1)
            {
                return new ApiResponse {
                           Status = "Inactive", Message = "User Inactive."
                }
            }
            ;
            else
            {
                return new ApiResponse {
                           Status = "Success", Message = UserName
                }
            };
        }
    }
}
 public void DeleteMeetingById(MeetingInfo meeting)
 {
     using (var context = new RepoDemo.MeetingDemoEntities())
     {
         context.MeetingDetails.Remove(context.MeetingDetails.Single(x => x.MeetingId == meeting.MeetingId));
         context.SaveChanges();
     }
 }
        public MeetingInfo GetMeetingById(int meetingId)
        {
            RepoDemo.MeetingDemoEntities DB = new RepoDemo.MeetingDemoEntities();
            var meeting = DB.MeetingDetails.FirstOrDefault(x => x.MeetingId == meetingId);

            return(new MeetingInfo
            {
                MeetingAgenda = meeting.MeetingAgenda,
                MeetingAttendees = meeting.MeetingAttendees,
                MeetingDateTime = meeting.MeetingDateTime,
                MeetingId = meeting.MeetingId,
                MeetingSubject = meeting.MeetingSubject
            });
        }
 public void SetMeeting(MeetingInfo meeting)
 {
     using (var context = new RepoDemo.MeetingDemoEntities())
     {
         var meetingInfo = new MeetingDetail
         {
             MeetingAgenda    = meeting.MeetingAgenda,
             MeetingAttendees = meeting.MeetingAttendees,
             MeetingDateTime  = meeting.MeetingDateTime,
             MeetingSubject   = meeting.MeetingSubject
         };
         context.MeetingDetails.Add(meetingInfo);
         context.SaveChanges();
     }
 }
 public void UpdateMeetingById(MeetingInfo meeting)
 {
     using (var context = new RepoDemo.MeetingDemoEntities())
     {
         var meetingInfo = new MeetingDetail
         {
             MeetingAgenda    = meeting.MeetingAgenda,
             MeetingAttendees = meeting.MeetingAttendees,
             MeetingDateTime  = meeting.MeetingDateTime,
             MeetingId        = meeting.MeetingId,
             MeetingSubject   = meeting.MeetingSubject
         };
         context.Entry(meetingInfo).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
        public IEnumerable <MeetingInfo> GetMeetings()
        {
            List <MeetingInfo> meetings = new List <MeetingInfo>();

            RepoDemo.MeetingDemoEntities DB = new RepoDemo.MeetingDemoEntities();
            var meetingDetails = DB.MeetingDetails;

            foreach (var meeting in meetingDetails)
            {
                meetings.Add(new MeetingInfo
                {
                    MeetingAgenda    = meeting.MeetingAgenda,
                    MeetingAttendees = meeting.MeetingAttendees,
                    MeetingDateTime  = meeting.MeetingDateTime,
                    MeetingId        = meeting.MeetingId,
                    MeetingSubject   = meeting.MeetingSubject
                });
            }
            return(meetings);
        }