public Response<SessionResponseTutorModel> GetSessionsForTutor(RequestEntity objReq)
        {
            Response<SessionResponseTutorModel> response = new Response<SessionResponseTutorModel>();
            List<SessionResponseTutorModel> objResp = new List<SessionResponseTutorModel>();
            try
            {
                Session obj = new Session();
                if (CheckRequestIsvalidornot(this.Request))
                {
                    objDbMethodV2 = new Dal.DbMethodsV2();
                    objResp = objDbMethodV2.GetSessionsForTutor(objReq);
                    if (objResp.Count > 0)
                        response.Create(true, Messages.FormatMessage(Messages.Success, "Session List"), Messages.AppVersion, objResp);
                    else
                        response.Create(true, Messages.FormatMessage(Messages.NoRecord), Messages.AppVersion, objResp);
                }
                else
                {

                    response.Create(false, Messages.FormatMessage(Messages.NotAllowedUser), Messages.AppVersion, objResp);
                }
            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            return response;
        }
        public Response<string> CancelSession(UniqueRequestModel objReq)
        {
            Response<string> response = new Response<string>();
            List<string> objResp = new List<string>();
            try
            {
                objDbMethodV2 = new wizz.Dal.DbMethodsV2();

                if (CheckRequestIsvalidornot(this.Request))
                {
                    if (ModelState.IsValid)
                    {
                        if (objDbMethodV2.CancelSession(objReq))
                            response.Create(true, Messages.FormatMessage(Messages.Success, "Session cancelled"), Messages.AppVersion, objResp);
                        else
                            response.Create(false, Messages.ErrorOccure, Messages.AppVersion, objResp);
                    }
                    else
                        response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp);
                }
                else
                    response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);

            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }

            return response;
        }
        public Response<SearchResponseTutorsModel> SaveStudentRequest(StudentRequestModelV2 objReq)
        {
            Response<SearchResponseTutorsModel> response = new Response<SearchResponseTutorsModel>();
            List<SearchResponseTutorsModel> objResp = new List<SearchResponseTutorsModel>();
            try
            {
                objDbMethodV2 = new wizz.Dal.DbMethodsV2();

                if (CheckRequestIsvalidornot(this.Request))
                {
                    if (ModelState.IsValid)
                    {
                        objResp.Add(objDbMethodV2.SaveStudentRequest(objReq));
                        if (objResp.Count > 0)
                            response.Create(true, Messages.FormatMessage(Messages.Success, "Student request saved"), Messages.AppVersion, objResp);
                        else
                            response.Create(false, "No tutor Found", Messages.AppVersion, objResp);
                    }
                    else
                        response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp);
                }
                else
                    response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);

            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }

            return response;
        }
 public Response<string> CreateSession(StartSessionModel objReq)
 {
     Response<string> response = new Response<string>();
     List<string> objResp = new List<string>();
     try
     {
         Session obj = new Session();
         if (CheckRequestIsvalidornot(this.Request))
         {
             objDbMethodV2 = new Dal.DbMethodsV2();
             if (objDbMethodV2.CreateSession(objReq))
                 response.Create(true, Messages.FormatMessage(Messages.Success, "Your session has been created"), Messages.AppVersion, objResp);
             else
                 response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);
         }
     }
     catch (Exception ex)
     {
         object session = new JavaScriptSerializer().Serialize(objReq);
         LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
         response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
     }
     return response;
 }
        public Response<string> SendOtp(OtpModel objReq)
        {
            Response<string> response = new Response<string>();
            List<string> objResp = new List<string>();
            try
            {
                objDbMethodV2 = new wizz.Dal.DbMethodsV2();

                if (CheckRequestIsvalidornot(this.Request))
                {
                    if (ModelState.IsValid)
                    {
                        string res = objDbMethodV2.SendOtp(objReq);
                        if (res == "4")
                        {
                            res = "Phone number already exists for a different user";
                        }

                        objResp.Add(res);
                        response.Create(false, Messages.FormatMessage(Messages.Success, "Otp"), Messages.AppVersion, objResp);

                    }
                    else
                        response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp);
                }
                else
                    response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);

            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }

            return response;
        }
        public Response<GetSettingsModel> GetEligibleCourses(UserIdModel objReq)
        {
            Response<GetSettingsModel> response = new Response<GetSettingsModel>();
            List<GetSettingsModel> objResp = new List<GetSettingsModel>();


            try
            {
                if (ModelState.IsValid)
                {
                    objDbMethodV2 = new wizz.Dal.DbMethodsV2();
                    if (CheckRequestIsvalidornot(this.Request))
                    {
                        objResp.Add(objDbMethodV2.GetEligibleCourses(objReq));
                        response.Create(true, " Eligiblie courses", Messages.AppVersion, objResp);
                    }
                    else
                    {
                        response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);
                    }
                }
                else
                    response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp);
            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            return response;
        }
        public Response<GetGroupModel> DeleteGroup(GetGroupRequest objReq)
        {
            // GroupModel objReq = new GroupModel();
            Response<GetGroupModel> response = new Response<GetGroupModel>();
            List<GetGroupModel> objResp = new List<GetGroupModel>();

            try
            {
                DbMethodsV2 objDBMethodV2 = new DbMethodsV2();

                if (CheckRequestIsvalidornot(this.Request))
                {




                    if (objDBMethodV2.DeleteGroup(objReq))
                    {
                        response.Create(true, Messages.FormatMessage(Messages.Success, "Group Deleted"), Messages.AppVersion, objResp);

                    }
                    else
                    {
                        response.Create(false, Messages.InvalidReq, Messages.AppVersion, objResp);
                    }

                }
                else
                {
                    response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);

                }

            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error(ex.Message, ex, session, ex.Message);
                response.Create(false, "Error occured while Processing Webservice request", Messages.AppVersion, objResp);
            }
            finally
            {
            }
            return response;
        }
        public Response<string> InviteFriends(InviteFriendsModel objReq)
        {
            Response<string> response = new Response<string>();
            List<string> objResp = new List<string>();
            try
            {
                if (ModelState.IsValid)
                {

                    objDbMethodV2 = new wizz.Dal.DbMethodsV2();
                    int retValue = objDbMethodV2.InviteFriends(objReq);
                    if (retValue > 0)
                        response.Create(true, "done", Messages.AppVersion, objResp);
                    else
                    {
                        response.Create(false, "you are not allowed", Messages.AppVersion, objResp);
                    }
                }
                else
                    response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp);

            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            finally
            {
            }
            return response;
        }
        public Response<SearchResponseTutorsModel> GetTutorBySearchCode(SearchTutorByCodeModel objReq)
        {
            Response<SearchResponseTutorsModel> response = new Response<SearchResponseTutorsModel>();
            List<SearchResponseTutorsModel> objResp = new List<SearchResponseTutorsModel>();


            try
            {
                if (ModelState.IsValid)
                {
                    objDbMethodV2 = new wizz.Dal.DbMethodsV2();
                    if (CheckRequestIsvalidornot(this.Request))
                    {
                        objResp.Add(objDbMethodV2.GetTutorBySearchCode(objReq));
                        if (objResp.Count > 0)
                            response.Create(true, "Tutor Data ", Messages.AppVersion, objResp);
                    }
                    else
                    {
                        response.Create(false, Messages.FormatMessage("Sorry no tutor found !!"), Messages.AppVersion, objResp);
                    }
                }
                else
                    response.Create(false, ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage, Messages.AppVersion, objResp);
            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            return response;
        }
        public Response<string> CreateGroup()
        {
            GroupModel objReq = new GroupModel();
            Response<string> response = new Response<string>();
            List<string> objResp = new List<string>();

            try
            {
                DbMethodsV2 objDBMethodV2 = new DbMethodsV2();

                if (CheckRequestIsvalidornot(this.Request))
                {
                    HttpContextWrapper objwrapper = GetHttpContext(this.Request);
                    HttpFileCollectionBase collection = objwrapper.Request.Files;

                    //var s = HttpContext.Current.Request;
                    //string jsonVlaue = s.Form["json"];
                    //HttpFileCollectionBase o = s.Files;


                    string jsonvalue = objwrapper.Request.Form["json"];
                    //     jsonvalue=HttpUtility.HtmlDecode(jsonvalue);
                    if (!string.IsNullOrEmpty(jsonvalue))
                    {
                        objReq = JsonConvert.DeserializeObject<GroupModel>(jsonvalue);
                        objReq.groupPic = SaveImage(collection, "");


                        if (objDBMethodV2.CreateGroup(objReq))
                        {
                            response.Create(true, Messages.FormatMessage(Messages.Success, "Created"), Messages.AppVersion, objResp);

                        }
                        else
                        {
                            response.Create(false, Messages.InvalidReq, Messages.AppVersion, objResp);
                        }
                    }
                    else
                    {
                        response.Create(false, Messages.InvalidReq, Messages.AppVersion, objResp);
                    }
                }
                else
                {
                    response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);

                }

            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error(ex.Message, ex, session, ex.Message);
                response.Create(false, "Error occured while Processing Webservice request", Messages.AppVersion, objResp);
            }
            finally
            {
            }
            return response;
        }
        public Response<string> SaveTutorProfile()
        {
            TutorProfileModel objReq = new TutorProfileModel();
            Response<string> response = new Response<string>();
            List<string> objResp = new List<string>();
            int resp = 0;
            try
            {
                objDbMethodV2 = new wizz.Dal.DbMethodsV2();
                if (CheckRequestIsvalidornot(this.Request))
                {
                    HttpContextWrapper objwrapper = GetHttpContext(this.Request);
                    HttpFileCollectionBase collection = objwrapper.Request.Files;
                    string jsonvalue = objwrapper.Request.Form["json"];
                    if (!string.IsNullOrEmpty(jsonvalue))
                    {
                        objReq = JsonConvert.DeserializeObject<TutorProfileModel>(jsonvalue);

                        List<string> newFileNames = new List<string>();

                        newFileNames = SaveMultipleFiles(collection, "");
                        //    objReq.fileNameList = newFileNames;
                        if (newFileNames.Count == 0)
                            response.Create(false, "No Transcripts is uploaded please try again !", Messages.AppVersion, objResp);
                        else
                            resp = objDbMethodV2.SaveTutorProfile(objReq, newFileNames);
                        if (resp == 1)
                        {
                            response.Create(true, "Tutor profile info saved successfully !", Messages.AppVersion, objResp);

                        }
                        else
                        {
                            response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);

                        }

                    }

                }
                return response;
            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            return response;
        }
        public Response<RespTutorAccountDetails> GetTutorBankDetails(ReqTutorAccountDetails objReq)
        {
            Response<RespTutorAccountDetails> response = new Response<RespTutorAccountDetails>();
            List<RespTutorAccountDetails> objResp = new List<RespTutorAccountDetails>();
            try
            {
                objDbMethodV2 = new wizz.Dal.DbMethodsV2();
                RespTutorAccountDetails tryObj = new RespTutorAccountDetails();
                tryObj = objDbMethodV2.GetTutorBankDetail(objReq);
                if (tryObj.accountNumber == null)
                {

                }
                else
                {
                    objResp.Add(tryObj);
                }

                if (objResp.Count > 0)
                {
                    response.Create(true, "done", Messages.AppVersion, objResp);

                }
                else
                {
                    //  objResp = new List<RespTutorAccountDetails>();
                    response.Create(false, "No data found", Messages.AppVersion, objResp);
                }
            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            finally
            {
            }
            return response;

            return response;

        }
        public Response<string> SaveTutorBankDetails(RespTutorAccountDetails objReq)
        {

            Response<string> response = new Response<string>();
            List<string> objResp = new List<string>();
            try
            {
                objDbMethodV2 = new wizz.Dal.DbMethodsV2();
                if (objDbMethodV2.PostBankAccountDetails(objReq))
                    response.Create(true, "done", Messages.AppVersion, objResp);
                else
                {
                    response.Create(false, "you are not allowed", Messages.AppVersion, objResp);
                }
            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            finally
            {
            }
            return response;



        }
        public Response<TutorOccupiedCalendarModel> GetTutorOccupiedCalendar(Entity objReq)
        {
            Response<TutorOccupiedCalendarModel> response = new Response<TutorOccupiedCalendarModel>();
            List<TutorOccupiedCalendarModel> objResp = new List<TutorOccupiedCalendarModel>();


            try
            {

                DbMethodsV2 obj = new DbMethodsV2();
                if (CheckRequestIsvalidornot(this.Request))
                {

                    objResp.Add(obj.GetTutorOccupiedCalendar(objReq));
                    response.Create(true, "Student Occupied list", Messages.AppVersion, objResp);
                }
                else
                {
                    response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);
                }
            }
            catch (Exception ex)
            {
                object session = new JavaScriptSerializer().Serialize(objReq);
                LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
                response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
            }
            return response;
        }
 public Response<CollegesModel> GetColleges()
 {
     Response<CollegesModel> response = new Response<CollegesModel>();
     List<CollegesModel> objResp = new List<CollegesModel>();
     try
     {
         objDbMethodV2 = new wizz.Dal.DbMethodsV2();
         if (CheckRequestIsvalidornot(this.Request))
         {
             objResp = objDbMethodV2.GetColleges();
             response.Create(true, "Colleges Data", Messages.AppVersion, objResp);
         }
         else
             response.Create(false, Messages.FormatMessage(Messages.InvalidReq), Messages.AppVersion, objResp);
     }
     catch (Exception ex)
     {
         object session = new JavaScriptSerializer().Serialize("");
         LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message);
         response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp);
     }
     return response;
 }