本文整理汇总了C#中RequestFields.Add方法的典型用法代码示例。如果您正苦于以下问题:C# RequestFields.Add方法的具体用法?C# RequestFields.Add怎么用?C# RequestFields.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestFields
的用法示例。
在下文中一共展示了RequestFields.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: clockInEmployee
/// <summary>
/// Clock in a single employee using timeclock.clockin
/// </summary>
/// <param name="id">ShiftPlanning ID of the employee to clock in</param>
/// <returns>API response data for timeclock.clockin</returns>
public APIResponse clockInEmployee(int id)
{
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "timeclock.clockin");
requestFields.Add("method", "GET");
requestFields.Add("employee", id);
this.setRequest(requestFields);
return response;
}
示例2: createAdminBackup
public APIResponse createAdminBackup(RequestFields details)
{
// create new admin file
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "admin.backup");
requestFields.Add("method", "CREATE");
//append details
foreach (KeyValuePair<string, object> fld in details)
requestFields.Add(fld.Key, fld.Value);
//append filedetails
RequestFields file_details = getFileData(details["filename"].ToString());
foreach (KeyValuePair<string, object> fld in file_details)
requestFields.Add(fld.Key, fld.Value);
this.setRequest(requestFields);
return response;
}
示例3: getStaffSkills
public APIResponse getStaffSkills()
{
// get a list of staff skills
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "staff.skills");
requestFields.Add("method", "GET");
this.setRequest(requestFields);
return response;
}
示例4: deleteVacationSchedule
public APIResponse deleteVacationSchedule(int id)
{
// delete a VacationSchedule by id
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "schedule.vacation");
requestFields.Add("method", "DELETE");
requestFields.Add("id", id);
this.setRequest(requestFields);
return response;
}
示例5: getStaffSkillDetails
public APIResponse getStaffSkillDetails(int id)
{
// get skill detail by id
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "staff.skill");
requestFields.Add("method", "GET");
requestFields.Add("id", id);
this.setRequest(requestFields);
return response;
}
示例6: updateVacationSchedule
public APIResponse updateVacationSchedule(RequestFields vacation_details)
{
// update VacationSchedule
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "schedule.vacation");
requestFields.Add("method", "UPDATE");
//append fields
foreach (KeyValuePair<string, object> fld in vacation_details)
requestFields.Add(fld.Key, fld.Value);
this.setRequest(requestFields);
return response;
}
示例7: getFileData
private RequestFields getFileData(string filename)
{
// get file details, (data, length, mimetype)
try
{
RequestFields file_data = new RequestFields();
if (File.Exists(filename))
{// file found
byte[] file_content = File.ReadAllBytes(filename);
file_data.Add("filepath", filename);
file_data.Add("filelength", file_content.Length);
string extension = filename.Substring(filename.LastIndexOf(".") + 1);
file_data.Add("mimetype", getFileMimeType(extension));
return file_data;
}
else
{// file not found
throw new Exception(this.internal_errors(8));
}
}
catch (Exception e)
{// any error
throw e;
}
}
示例8: getWallMessages
public APIResponse getWallMessages()
{
// get messages for the currently logged in user
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "messaging.wall");
requestFields.Add("method", "GET");
this.setRequest(requestFields);
return response;
}
示例9: doLogin
/*
* User Authentication Methods
*
*/
public APIResponse doLogin(RequestFields login_details)
{
// perform a login api call
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "staff.login");
requestFields.Add("method", "GET");
//append message fields
foreach (KeyValuePair<string, object> fld in login_details)
requestFields.Add(fld.Key, fld.Value);
this.setRequest(requestFields);
return response;
}
示例10: getEmployeeDetails
public APIResponse getEmployeeDetails(int id)
{
// get employee details by id
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "staff.employee");
requestFields.Add("method", "GET");
requestFields.Add("id", id);
this.setRequest(requestFields);
return response;
}
示例11: getEmployees
/*
* Staff Methods
*
*/
public APIResponse getEmployees()
{
// get a list of employees
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "staff.employees");
requestFields.Add("method", "GET");
this.setRequest(requestFields);
return response;
}
示例12: getAPIConfig
/*
* API Methods
*
*/
public APIResponse getAPIConfig()
{
// get API config
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "api.config");
requestFields.Add("method", "GET");
this.setRequest(requestFields);
return response;
}
示例13: getAPIMethods
public APIResponse getAPIMethods()
{
// get API methods
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "api.methods");
requestFields.Add("method", "GET");
this.setRequest(requestFields);
return response;
}
示例14: getAdminSettings
public APIResponse getAdminSettings()
{
// get admin settings
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "admin.settings");
requestFields.Add("method", "GET");
this.setRequest(requestFields);
return response;
}
示例15: getAdminFileDetails
public APIResponse getAdminFileDetails(int id)
{
// get admin file details
RequestFields requestFields = new RequestFields();
requestFields.Add("module", "admin.file");
requestFields.Add("method", "GET");
requestFields.Add("id", id);
this.setRequest(requestFields);
return response;
}