我正在开发 asp.net Web 应用程序。我正在通过 lists.asmx Web 服务访问共享点列表数据。同样,我通过lists.asmx 在sharepoint 列表中添加数据。我添加新列表项的代码如下
public void InsertDataInClientList(Client clientObj)
{
PBSWebApplication.LocalHostServiceReference.ListsSoapClient proxy = Utility.GetLocalProxy();
try
{
XmlDocument doc = new XmlDocument();
XmlElement batch = doc.CreateElement("Batch");
batch.InnerXml = "<Method ID='1' Cmd='New'>"
+ "<Field Name='FirstName'>" + clientObj.FirstNameOfIndividual + "</Field>"
+ "<Field Name='Last_x0020_Name'>" + clientObj.LastNameOfIndividual + "</Field>"
+ "<Field Name='PATIENT_x0020_DOB'>" + clientObj.DateOfBirth.ToString("yyyy-MM-dd") + "</Field>"
+ "<Field Name='Age'>" + clientObj.Age + "</Field>"
+ "<Field Name='Gender'>" + clientObj.Gender + "</Field>"
+ "<Field Name='Preferred_x0020_By'>" + clientObj.ReferredBy + "</Field>"
+ "<Field Name='Parent_x002f_Caregiver_x0020_Fir'>" + clientObj.Parent1FirstName + "</Field>"
+ "<Field Name='Parent_x002f_Caregiver_x0020_Las'>" + clientObj.Parent1LastName + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_Street_x002'>" + clientObj.Parent1StreetAddress + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_City'>" + clientObj.Parent1City + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_State'>" + clientObj.Parent1State + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_Zip'>" + clientObj.Parent1Zip + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_Home_x0020_'>" + clientObj.Parent1HomePhone + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_Work_x0020_'>" + clientObj.Parent1WorkPhone + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_Mobile_x002'>" + clientObj.Parent1MobilePhone + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_Mobile_x002'>" + clientObj.Parent1MobilePhone + "</Field>"
+ "<Field Name='Parent_x0020_1_x0020_Email'>" + clientObj.Parent1Email + "</Field>"
+ "<Field Name='Marital_x0020_Status'>" + clientObj.Parent1MaritalStatus + "</Field>"
+ "<Field Name='Parent_x0020_2_x002f_Caregiver_x'>" + clientObj.Parent2FirstName + "</Field>"
+ "<Field Name='Parent_x0020_2_x002f_Caregiver_x0'>" + clientObj.Parent2LastName + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_Street_x002'>" + clientObj.Parent2StreetAddress + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_City'>" + clientObj.Parent2City + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_State'>" + clientObj.Parent2State + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_Zip'>" + clientObj.Parent2Zip + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_Home_x0020_'>" + clientObj.Parent2HomePhone + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_Work_x0020_'>" + clientObj.Parent2WorkPhone + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_Mobile_x002'>" + clientObj.Parent2MobilePhone + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_Email'>" + clientObj.Parent2Email + "</Field>"
+ "<Field Name='Parent_x0020_2_x0020_Marital_x00'>" + clientObj.Parent2MaritalStatus + "</Field>"
+ "<Field Name='Insurance_x0020_Company_x0020_Na'>" + clientObj.InsuranceCompanyName + "</Field>"
+ "<Field Name='INSURED'>" + clientObj.InsuredCardHoldersName + "</Field>"
+ "<Field Name='INSURED_x0020_DOB'>" + clientObj.InsuredCardHoldersDateOfBirth.ToString("yyyy-MM-dd") + "</Field>"
+ "<Field Name='Insured_x0020_SSN'>" + clientObj.InsuredSSN + "</Field>"
+ "<Field Name='Member_x0020_Number'>" + clientObj.MemberNumber + "</Field>"
+ "<Field Name='GROUP_x0020__x0023_'>" + clientObj.GroupNumber + "</Field>"
+ "<Field Name='Physician'>" + clientObj.Physician + "</Field>"
+ "<Field Name='Physician_x0020_Phone_x0020_Numb'>" + clientObj.PhysicianPhoneNumber + "</Field>"
+ "<Field Name='Medicaid_x0020_Id'>" + clientObj.MedicaidNumber + "</Field>"
+ "<Field Name='Need_x0020_additional_x0020_help'>" + clientObj.NeedAdditionalHelp + "</Field>"
+ "<Field Name='Interested_x0020_in_x0020_Speech'>" + clientObj.InterestedInSpeechAndLanguageServices + "</Field>"
+ "<Field Name='Interested_x0020_in_x0020_Occupa'>" + clientObj.InterestedInOccupationalTherapy + "</Field>"
+ "</Method>";
XElement xElement = Utility.ToXElement(batch);
proxy.UpdateListItems("Clients", xElement);
}
catch (Exception ex)
{
Utility.ShowErrorMessage(ex);
}
}
上面的代码工作正常。我可以添加新的列表项。在上面的代码中,“客户”列表是自定义列表。现在在“客户”列表中,我还有一个字段名为 Image。它属于“超链接或图像”类型。我可以通过提供网址手动在此列中添加图像。但我想通过后面的代码添加这个图像。我有图像的字节数组。我也有源网址。我想添加具有上述字段值的图像。我想为特定列表项添加图像。意味着我想通过添加图像来更新列表项。我该怎么做。您能否提供我可以解决上述问题的任何代码或链接?