// This method used for the login public TokenResponse loginUser(string userBodyData) { TokenResponse result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "token", "POST", userBodyData, false); if (CommonClasses.checkResposeResult(resultApi)) { result = JsonConvert.DeserializeObject <TokenResponse>(resultApi.ToString()); } else { throw new Exception(CommonMessage.LOGIN_USERPASS_WORNG); } return(result); }
public User verifyUser(string verificationCode) { User result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + GlobalClass.user.userId + "/verify/" + verificationCode, "GET", null, false); if (CommonClasses.checkResposeResult(resultApi)) { result = JsonConvert.DeserializeObject <User>(resultApi.ToString()); } else { throw new Exception(CommonMessage.USER_VERIFIED_UNSUCCESS); } return(result); }
// This method used for the delete the hotel tabel deatils public String deleteHotelTable(HotelTableModel hotelTableModel) { String result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "delete/" + hotelTableModel.hotelTableId, "DELETE", null, true); if (CommonClasses.checkResposeResult(resultApi)) { result = resultApi.ToString(); this.getHotelTables(true); } else { throw new Exception(CommonMessage.HOTEL_TABLE_DELETE_UNSUCCESS_MESSAGE); } return(result); }
// This method used for the update the hotel table deatils public HotelTableModel updateHotelTable(int hotelTableId, string hotelTableBodyData) { HotelTableModel result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "update/" + hotelTableId, "PUT", hotelTableBodyData, true); if (CommonClasses.checkResposeResult(resultApi)) { result = JsonConvert.DeserializeObject <HotelTableModel>(resultApi.ToString()); this.getHotelTables(true); } else { throw new Exception(CommonMessage.HOTEL_TABLE_UPDATE_UNSUCCESS_MESSAGE); } return(result); }
// This method used for the delete the food deatils public String deleteFood(FoodModel foodModel) { String result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "delete/" + foodModel.foodId, "DELETE", null, true); if (CommonClasses.checkResposeResult(resultApi)) { result = resultApi.ToString(); this.getFoods(true); } else { throw new Exception(CommonMessage.FOOD_DELETE_UNSUCCESS_MESSAGE); } return(result); }
// This method used for the update the food deatils public FoodModel updateFood(int foodId, string foodBodyData) { FoodModel result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "update/" + foodId, "PUT", foodBodyData, true); if (CommonClasses.checkResposeResult(resultApi)) { result = JsonConvert.DeserializeObject <FoodModel>(resultApi.ToString()); this.getFoods(true); } else { throw new Exception(CommonMessage.FOOD_UPDATE_UNSUCCESS_MESSAGE); } return(result); }
// This method used for the update the profile public String deleteCustomer(CustomerModel customerModel) { String result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "delete/" + customerModel.customerId, "DELETE", null, true); if (CommonClasses.checkResposeResult(resultApi)) { result = resultApi.ToString(); this.getCustomers(true); } else { throw new Exception(CommonMessage.CUSTOMER_DELETE_UNSUCCESS_MESSAGE); } return(result); }
// This method used for the update the profile public CustomerModel updateCustomer(int customerId, string customerBodyData) { CustomerModel result = null; Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "update/" + customerId, "PUT", customerBodyData, true); if (CommonClasses.checkResposeResult(resultApi)) { result = JsonConvert.DeserializeObject <CustomerModel>(resultApi.ToString()); this.getCustomers(true); } else { throw new Exception(CommonMessage.CUSTOMER_UPDATE_UNSUCCESS_MESSAGE); } return(result); }
// This method use for the regsiter the user. public User registerUser(User user) { User result = null; var userBodyData = JsonConvert.SerializeObject(new { userEmail = user.userEmail, userPassword = user.userPassword, userName = user.userName }); Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "register", "POST", userBodyData, false); if (CommonClasses.checkResposeResult(resultApi)) { result = JsonConvert.DeserializeObject <User>(resultApi.ToString()); } else { throw new Exception(CommonMessage.APP_USER_CREATION_FAIL); } return(result); }
// This method used for the get the hotel tabel list public List <HotelTableModel> getHotelTables(Boolean recall) { List <HotelTableModel> result = null; if (GlobalClass.hotelTableModelList == null || recall) { Object resultApi = new CommonApiOperation().apiCall(this.commonUrl + "gets", "GET", null, true); if (CommonClasses.checkResposeResult(resultApi)) { result = JsonConvert.DeserializeObject <List <HotelTableModel> >(resultApi.ToString()); GlobalClass.hotelTableModelList = result; GlobalClass.hotelTables = new ListToDataTableConvetor().ToDataTable <HotelTableModel>(result); } else { throw new Exception(CommonMessage.HOTEL_TABLE_NO_RECORD_MESSAGE); } } else { result = GlobalClass.hotelTableModelList; } return(result); }