public Response<string> LogOutService(ReqLogOut objReq) { Response<string> response = new Response<string>(); List<string> objResp = new List<string>(); try { WebMethods objDBMethod = new WebMethods(); if (CheckRequestIsvalidornot(this.Request)) { if (ModelState.IsValid) { if (objDBMethod.UserLogout(objReq)) response.Create(true, Messages.FormatMessage(Messages.Success, "Logged out"), 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<string> ChangePassword(ChangePasswordModel objReq) { Response<string> response = new Response<string>(); List<string> objResp = new List<string>(); try { WebMethods objDBMethod = new WebMethods(); if (CheckRequestIsvalidornot(this.Request)) { if (ModelState.IsValid) { switch (objDBMethod.ChangePassword(objReq)) { case 1: response.Create(true, Messages.FormatMessage(Messages.Success, "Password changed"), Messages.AppVersion, objResp); break; case 0: response.Create(false, "User do not exists", Messages.AppVersion, objResp); break; case 2: response.Create(false, "You are not allowed to change", Messages.AppVersion, objResp); break; case 3: response.Create(false, "Your old password is wrong", Messages.AppVersion, objResp); break; default: break; } } 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<RespIsTeacherRequest> ChangeTutorStatus(IsTeacherRequest objReq) { Response<RespIsTeacherRequest> response = new Response<RespIsTeacherRequest>(); List<RespIsTeacherRequest> objResp = new List<RespIsTeacherRequest>(); try { WebMethods objDBMethod = new WebMethods(); if (CheckRequestIsvalidornot(this.Request)) { if (ModelState.IsValid) { objResp.Add(objDBMethod.isTeacher(objReq)); if (objResp != null) { response.Create(true, Messages.FormatMessage(Messages.Success, "Status Changed"), 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); } finally { } return response; }
public Response<string> SendPushForIos(IosPushModel objReq) { Response<string> response = new Response<string>(); List<string> objResp = new List<string>(); try { WebMethods obj = new WebMethods(); if (CheckRequestIsvalidornot(this.Request)) { if (obj.SendPushForIos(objReq)) { response.Create(true, "Message sent", 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); } finally { } return response; }