public void FormEvents_Submit(object sender, SubmitEventArgs e) { FileSubmitConnection fc = (FileSubmitConnection)this.DataConnections["SharePoint Library Submit"]; fc.Filename.SetStringValue("Message - " + DateTime.Now.ToString("yyyymmddhhmmss")); fc.Execute(); e.CancelableArgs.Cancel = false; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite elevatedSite = new SPSite("http://pobalfba")) { using (SPWeb elevatedWeb = elevatedSite.OpenWeb()) { elevatedWeb.AllowUnsafeUpdates = true; SPList logsList = elevatedWeb.Lists.TryGetList("Logs"); SPListItem newItem = logsList.AddItem(); newItem["Title"] = string.Format("User: {0}; Date/Time: {1}", elevatedWeb.CurrentUser.LoginName, DateTime.Now.ToLongDateString()); newItem.Update(); elevatedWeb.AllowUnsafeUpdates = true; } } }); }
public void mentes() { //try //{ MainDataSource.CreateNavigator().SelectSingleNode("/my:sajátMezők/my:Alapadatok/my:SAP", NamespaceManager).SetValue(Form1.formSAP); MainDataSource.CreateNavigator().SelectSingleNode("/my:sajátMezők/my:Alapadatok/my:Posta", NamespaceManager).SetValue(Form1.posta); FileSubmitConnection fc = DataConnections["UpLoad"] as FileSubmitConnection; // adatok Sharepoint-ba küldéshez deklaráció fc.Execute(); // adatok Sharepoint-ba küldése DialogResult dr6 = MessageBox.Show("A mentés sikeresen megtörtént!", "Figyelem!", MessageBoxButtons.OK, MessageBoxIcon.Information); //this.Application.Quit(); //} //catch //{ // MessageBox.Show("Az iktatószám mentése sikertelen volt, ellenőrizd a hálózati kapcsolatod!", "Figyelem:"); // } }
} // private void AddUserToSiteGroups() public void FormEvents_Submit(object sender, SubmitEventArgs e) { // If the submit operation is successful, set // e.CancelableArgs.Cancel = false; // Write your code here. try { AddUserToSelectedSiteGroups(); FileSubmitConnection conSubmit = (FileSubmitConnection)DataConnections["SharePoint Library Submit"]; conSubmit.Execute(); e.CancelableArgs.Cancel = false; } catch (Exception ex) { e.CancelableArgs.Message = ex.Message; e.CancelableArgs.Cancel = true; } this.ViewInfos.SwitchView("Thanks"); }