public void CreateItem() { var res = FreshBooks.CreateRequestXML("item.create", x => x.item = new { name = "Fuzzy Slippers", description = "Extra soft", unit_cost = "59.99", quantity = 1, inventory = 10 }); Console.Write(res.ToString()); }
public static List <FBProject> GetFBProjects(Instance_Config instanceConfig, int page, int limit, int clientID, int staffID) { List <FBProject> arrProjects; string result = FreshBooks.GetProjectsList(instanceConfig, out arrProjects, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, limit, page, clientID, staffID); if (result == "ok") { return(arrProjects); } else { throw new HttpError(HttpStatusCode.NotFound, result.Replace("\n", " ").Replace("\r", " ")); } }
public static FBClient CreateClient(ApiUser User, Instance_Config instanceConfig, int accountID) { FBClient fbClient; string result = FreshBooks.CreateClient(User.OrganizationId, User.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, accountID, out fbClient); if (result == "ok") { return(fbClient); } else { throw new HttpError(HttpStatusCode.NotFound, Utils.ClearString(result)); } }
public static List <FBCategory> GetFBCategories(Instance_Config instanceConfig) { List <FBCategory> arrCategories; string result = FreshBooks.GetCategoryList(instanceConfig, out arrCategories, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret); if (result == "ok") { return(arrCategories); } else { throw new HttpError(HttpStatusCode.NotFound, Utils.ClearString(result)); } }
public static List <FBStaff> GetFBStaff(Instance_Config instanceConfig, int page, int limit) { List <FBStaff> arrStaff; string result = FreshBooks.GetStaffList(instanceConfig, out arrStaff, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, limit, page); if (result == "ok") { return(arrStaff); } else { throw new HttpError(HttpStatusCode.NotFound, Utils.ClearString(result)); } }
public static FBTask CreateTask(ApiUser User, Instance_Config instanceConfig, int taskTypeID, int fbProjectID) { FBTask fbTask; string result = FreshBooks.CreateTask(User.OrganizationId, User.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, taskTypeID, fbProjectID, out fbTask); if (result == "ok") { return(fbTask); } else { throw new HttpError(HttpStatusCode.NotFound, Utils.ClearString(result)); } }
public static FBTask FindFBTask(Instance_Config instanceConfig, string name) { FBTask arrTask; string result = FreshBooks.FindTask(instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, name, out arrTask); if (result == "ok") { if (arrTask == null) { arrTask = new FBTask(0, ""); } return(arrTask); } else { throw new HttpError(HttpStatusCode.NotFound, Utils.ClearString(result)); } }
public void CreateTimeEntry() { var fb = Shared.NewCaller(); var res = FreshBooks.CreateRequestXML("time_entry.create", x => x.time_entry = new { task_id = 999999, hours = 25, something = "else" }); Console.Write(res.ToString()); dynamic time_entry = new ExpandoObject(); time_entry.task_id = 999998; time_entry.hours = 24; time_entry.something = "otherwise"; res = FreshBooks.CreateRequestXML("time_entry.create", x => x.time_entry = time_entry); Console.Write(res.ToString()); }
public static void UnlinkFreshBooksTimeEntry(ApiUser hdUser, int timeLogID, bool isProjectLog) { FreshBooks.UnlinkFreshBooksTimeEntry(hdUser.OrganizationId, hdUser.DepartmentId, timeLogID, isProjectLog); }
public static void UpdateData(ApiUser User, int userID, int fbStaffID, int accountID, int fbClientId, int projectID, int fbProjectID, int taskTypeID, int fbTaskTypeID) { FreshBooks.UpdateData(User.OrganizationId, User.DepartmentId, userID, fbStaffID, accountID, fbClientId, projectID, fbProjectID, taskTypeID, fbTaskTypeID); }
public static string CreateTimeEntry(ApiUser hdUser, Instance_Config instanceConfig, int staffID, int projectID, int taskID, decimal hours, string notes, DateTime date, int timeLogID, bool isProjectLog) { return(FreshBooks.CreateTimeEntry(hdUser.OrganizationId, hdUser.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, staffID, projectID, taskID, hours, notes, date, timeLogID, isProjectLog)); }
public static void DeleteFreshBooksExpense(ApiUser hdUser, Instance_Config instanceConfig, string expenseID) { FreshBooks.DeleteAndUnlinkExpense(hdUser.OrganizationId, hdUser.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, expenseID); }
public static void UnlinkFreshBooksExpense(ApiUser hdUser, string expenseID) { FreshBooks.UnlinkFreshBooksExpense(hdUser.OrganizationId, hdUser.DepartmentId, expenseID); }
public static void UnlinkFreshBooksProject(ApiUser hdUser, int projectID) { FreshBooks.UnlinkFreshBooksProject(hdUser.OrganizationId, hdUser.DepartmentId, projectID); }
public void Clients_Get_Request() { var req = FreshBooks.CreateRequestXML("client.get", x => x.client_id = 12); Console.Write(req.ToString()); }
public static void DeleteFreshBooksCategory(ApiUser hdUser, Instance_Config instanceConfig, string categoryID) { FreshBooks.DeleteAndUnlinkCategory(hdUser.OrganizationId, hdUser.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, categoryID); }
public static void UnlinkFreshBooksCategory(ApiUser hdUser, string categoryID) { FreshBooks.UnlinkFreshBooksCategory(hdUser.OrganizationId, hdUser.DepartmentId, categoryID); }
public static void DeleteFreshBooksProject(ApiUser hdUser, Instance_Config instanceConfig, int projectID) { FreshBooks.DeleteAndUnlinkProject(hdUser.OrganizationId, hdUser.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, projectID); }
public static void UnlinkFreshBooksStaff(ApiUser hdUser, int userID) { FreshBooks.UnlinkFreshBooksStaff(hdUser.OrganizationId, hdUser.DepartmentId, userID); }
public static void UnlinkFreshBooksTask(ApiUser hdUser, int taskTypeID) { FreshBooks.UnlinkFreshBooksTask(hdUser.OrganizationId, hdUser.DepartmentId, taskTypeID); }
public static void UnlinkFreshBooksExpense(ApiUser hdUser, int accountID) { FreshBooks.UnlinkFreshBooksClient(hdUser.OrganizationId, hdUser.DepartmentId, accountID); }
public static void DeleteFreshBooksTimeEntry(ApiUser hdUser, Instance_Config instanceConfig, int timeLogID, bool isProjectLog) { FreshBooks.DeleteAndUnlinkTimeEntry(hdUser.OrganizationId, hdUser.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, timeLogID, isProjectLog); }
public static void DeleteFreshBooksTask(ApiUser hdUser, Instance_Config instanceConfig, int taskTypeID) { FreshBooks.DeleteAndUnlinkTask(hdUser.OrganizationId, hdUser.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, taskTypeID); }
public static string CreateExpense(ApiUser hdUser, Instance_Config instanceConfig, int staffID, int projectID, int categoryID, int clientID, decimal amount, string vendor, string notes, DateTime date, string expenseID, int fbExpenseID) { return(FreshBooks.CreateExpense(hdUser.OrganizationId, hdUser.DepartmentId, instanceConfig, instanceConfig.FBoAuthConsumerKey, instanceConfig.FBoAuthSecret, staffID, projectID, categoryID, clientID, amount, vendor, notes, date, expenseID, fbExpenseID)); }