海每个人,
在此我有三个参数如何将 methodname.Equals('xx') 方法移出到单独的方法中。
public static String APIMethod(string modulename,string methodname,string postContent )
{
string recordId = "1";
string uri = zohocrmurl + modulename + "/"+methodname+"?";
/* Append your parameters here */
postContent = "scope=crmapi";
postContent = postContent + "&authtoken=0ac32dc177c4918eca902fd290a92f4a";//Give your authtoken
//how to move this and create them as seperate methods
**if (methodname.Equals("insertRecords") || methodname.Equals("updateRecords"))
{
postContent = postContent + "&xmlData="+ HttpUtility.UrlEncode("Your CompanyHannahSmithtesting@testing.com");
}
if (methodname.Equals("updateRecords") || methodname.Equals("deleteRecords") || methodname.Equals("getRecordById"))
{
postContent = postContent + "&id="+recordId;
}**
string result = AccessCRM(uri, postContent);
return result;
}