Moss: Uppdatering orodha desturi

Kuna mifano mingi nzuri ya uppdatering orodha ya desturi kupitia SDK. Hapa ni jingine.

Biashara tatizo: Fomu InfoPath umebuniwa kwamba inawezesha watumiaji kuingia Maombi ya kununua online. PO shurutisho idadi lazima jadi mlolongo makao integer maadili na mahesabu moja kwa moja.

Business Solution: Kujenga desturi MOSS orodha zenye safu mbili: "ControlField" and "ControlValue". safu ya thamani ina ijayo kununua Shurutisho ya simu. Note that the generic "control" kumtaja mkataba hutoa kwa ajili ya mashamba ya baadaye ya kudhibiti kwamba inaweza kutumika kama inahitajika.

Kiufundi Solution: Kujenga huduma ya mtandao kupatikana kwa mteja InfoPath. huduma ya mtandao anarudi nyuma ijayo kununua Shurutisho simu updates na thamani ya orodha.

Yaliyojitokeza:

  • Wakati kuongeza huduma hii ya mtandao kama chanzo data kwa ajili ya InfoPath, Nimeona ni muhimu kubadilisha kwa UDC na kuhifadhi katika maktaba uhusiano data.
  • Mimi pia kupatikana ni muhimu ili kuwawezesha msalaba uwanja scripting kupitia huduma ya kati ya utawala // maombi ya usimamizi // fomu server Configuration.
  • mara ya kwanza fomu alijaribu kupata huduma ya mtandao, inachukua muda na juu ya tukio, itakuwa muda nje. Mimi fiddled na mazingira katika fomu muundo wa kompyuta kupanua mazingira ya umeisha na kwamba walionekana kusaidia.

kanuni:

kutumia Mfumo;
kutumia System.Web;
kutumia System.Web.Services;
kutumia System.Web.Services.Protocols;
kutumia Microsoft.SharePoint;
kutumia System.Configuration;

[Webservice(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
umma darasani PoService : System.Web.Services.Webservice
{
umma PoService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

/// <muhtasari>
/// Obtain the next PO number from the sharepoint po number control list.
/// Increment the PO number in that list.
/// </muhtasari>
/// <anarudi></anarudi>
[WebMethod]
umma string GetNextPoNumber()
{
string SpPoControlSiteName; // Name of the actual MOSS site that hosts the PO Control list.
string SpPoControlListName; // Name of the actual MOSS list containing the Po control.

SpPoControlSiteName = ConfigurationSettings.AppSettings["PoControlListHostingSite"].ToString();
SpPoControlListName = ConfigurationSettings.AppSettings["PoControlList"].ToString();

string nextPoReqNumber = "xyzzy";

kutumia (SPSite site = mpya SPSite(SpPoControlSiteName))
{
kutumia (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpPoControlListName];

foreach (SPItem controlItem katika currentList.Items)
{

kama (((string)controlItem["ControlField"]).Sawa na("NextPoNumber"))
{
nextPoReqNumber = (string)controlItem["ControlValue"];

int int_nextPoReqNumber;
int_nextPoReqNumber = Kubadilisha.ToInt32(nextPoReqNumber);

int_nextPoReqNumber ;

controlItem["ControlValue"] = int_nextPoReqNumber;
controlItem.Update();
}

} // Locating, reading and updating the PO number in the list.


} // using spweb web = site.openweb()
} // using spsite site = new spsite("http://localhost/mizuho")

kurudi nextPoReqNumber;

}
}

Wazo moja juu ya "Moss: Uppdatering orodha desturi

  1. KSP aliandika:
    Hi Paulo,
    Tuna hali kama hiyo nini ni kutaja lakini tatizo ni i wanataka kutumia hii servie mtandao kwenye server.Hence mizani mzigo,jinsi ya kushughulikia maombi concurrency katika kesi hii au jinsi ya kufanya mpya ombi kusubiri na ombi moja tu lazima update simu orodha mpaka basi kila maombi mengine lazima katika que.Please napenda kujua jinsi ya kufanikisha hili.
    Shukrani katika Advance.
    Kujibu

Kuondoka Reply

Anwani yako si kuchapishwa. Mashamba required ni alama *