예제 #1
0
        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 WriteGemsAVData(SubmitEventArgs args)
        {
            //Write header
            PCsvFile.Write(
                "Wonder" + Delimeter
                + "Transcendence" + Delimeter
                + "Power" + Delimeter
                + "Tenderness" + Delimeter
                + "Nostalgia" + Delimeter
                + "Peacefulness" + Delimeter
                + "Joyful Activation" + Delimeter
                + "Sadness" + Delimeter
                + "Tension" + Delimeter
                + "Arousal" + Delimeter
                + "Valence" + Delimeter
                + "AVTension" + Delimeter
                + "Like" + Delimeter);
            PCsvFile.WriteLine();

            PCsvFile.Write(
                args.Wonder + Delimeter
                + args.Transcendence + Delimeter
                + args.Power + Delimeter
                + args.Tenderness + Delimeter
                + args.Nostalgia + Delimeter
                + args.Peacefulness + Delimeter
                + args.JoyfulActivation + Delimeter
                + args.Sadness + Delimeter
                + args.Tension + Delimeter
                + args.Arousal + Delimeter
                + args.Valence + Delimeter
                + args.Tense + Delimeter
                + args.Like + Delimeter);
            PCsvFile.WriteLine();
        }
 protected virtual void onSubmit(SubmitEventArgs e)
 {
     if (submitEvent != null)
     {
         submitEvent(this, e);
     }
 }
        public void Submit()
        {
            SubmitEventArgs ret = new SubmitEventArgs {
                InputText = "HOGE"
            };

            SubmitDialog(this, ret);
        }
예제 #5
0
        /// <summary>
        /// Submit Nodes
        /// </summary>
        protected void SubmitNodes(object sender, SubmitEventArgs e)
        {
            try {
                var columns = new List <ACVFilterInfo>();
                foreach (var sNode in e.RootNode.Children)
                {
                    var column = new ACVFilterInfo();
                    column.ColName    = sNode.Text;
                    column.FilterItem = sNode.Attributes["filterItem"].ToString();
                    var filterType = Int32.Parse(sNode.Attributes["filterType"].ToString());
                    column.FilterType = Enum.IsDefined(typeof(EnmActiveValuesFiteType), filterType) ? (EnmActiveValuesFiteType)filterType : EnmActiveValuesFiteType.NodeName;
                    var nodeType = Int32.Parse(sNode.Attributes["vNodeType"].ToString());
                    column.NodeType = Enum.IsDefined(typeof(EnmNodeType), nodeType) ? (EnmNodeType)nodeType : EnmNodeType.Null;
                    column.DevName  = sNode.Attributes["devName"].ToString();
                    column.IsNew    = Boolean.Parse(sNode.Attributes["isNew"].ToString());
                    columns.Add(column);
                }

                if (columns.Count > 0 && LscsComboBox.SelectedItem != null)
                {
                    var nodeId = LscsComboBox.SelectedItem.Value;
                    var ids    = WebUtility.ItemSplit(nodeId);
                    if (ids.Length != 2)
                    {
                        WebUtility.ShowNotify(EnmErrType.Warning, "获取客户端参数时发生错误,数据保存失败!");
                        return;
                    }

                    var lscId     = Int32.Parse(ids[0]);
                    var groupId   = Int32.Parse(ids[1]);
                    var lscEntity = new BLsc();
                    var lsc       = lscEntity.GetLsc(lscId);
                    if (lsc == null)
                    {
                        WebUtility.ShowNotify(EnmErrType.Warning, "无法获取客户端信息,数据保存失败!");
                        return;
                    }

                    var userData = UserData;
                    var lscUser  = userData.LscUsers.Find(lui => { return(lui.LscID == lsc.LscID); });
                    if (lscUser == null)
                    {
                        WebUtility.ShowNotify(EnmErrType.Warning, "无法获取用户信息,数据保存失败!");
                        return;
                    }

                    var connectionString    = WebUtility.CreateLscConnectionString(lsc);
                    var reportSettingEntity = new BSetting();
                    columns = reportSettingEntity.UpdateLSCActiveValuesFilterCols(connectionString, lscUser.UID, columns);
                    reportSettingEntity.UpdateCSCActiveValuesFilterCols(lscUser.LscID, lscUser.UID, columns);
                    lscUser.ActiveValuesFiterItem = columns;
                    WebUtility.ShowNotify(EnmErrType.Info, "数据已保存成功!");
                }
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
        public void FormEvents_Submit(object sender, SubmitEventArgs e)
        {
            var UriBuilder = new UriBuilder("http://smsgateway.me/api/v3/messages/send/");
            var parameters = HttpUtility.ParseQueryString(string.Empty);

            parameters["email"]    = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:email", NamespaceManager).Value;
            parameters["password"] = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:password", NamespaceManager).Value;
            parameters["device"]   = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:device", NamespaceManager).Value;;
            parameters["number"]   = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:MobileNumber", NamespaceManager).Value;
            parameters["message"]  = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:SMS_TO_BE_SENT", NamespaceManager).Value;;
            UriBuilder.Query       = parameters.ToString();
            //UriBuilder.Fragment = "some_fragment";

            Uri finalUrl = UriBuilder.Uri;
            var request  = WebRequest.Create(finalUrl);

            // Get the response.
            WebResponse result = request.GetResponse();



            // Get the stream containing content returned by the server.
            Stream dataStream = result.GetResponseStream();
            // Open the stream using a StreamReader for easy access.
            StreamReader reader = new StreamReader(dataStream);
            // Read the content.
            string responseFromServer = reader.ReadToEnd();


            var successRoot = JsonConvert.DeserializeObject <RootObject>(responseFromServer);

            var isSuccess = successRoot.result.success != null && successRoot.result.success.Count > 0;
            var isFail    = successRoot.result.fails != null && successRoot.result.fails.Count > 0;

            if (isSuccess)
            {
                var id      = successRoot.result.success.First().id;
                var message = successRoot.result.success.First().message;
                // Display the content.

                string value  = Convert.ToString(id);
                string value1 = Convert.ToString(message);
                System.Windows.Forms.MessageBox.Show("SMS " + value + " " + value1 + " Sent SuccessFully");
            }
            else
            {
                //var messagefail = successRoot.result.fails.First().device;
                //string value = Convert.ToString(messagefail);

                System.Windows.Forms.MessageBox.Show("SMS Could Not Be Sent. Check Device");
            }

            // Clean up the streams.
            reader.Close();
            dataStream.Close();
            result.Close();
        }
예제 #7
0
        /// <summary>
        /// Selections the vm single submitted.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private async void SelectionVm_SingleSubmitted(object sender, SubmitEventArgs <List <object> > e)
        {
            if (sender is SelectionViewModel <TestItem> vm)
            {
                vm.Submitted -= SelectionVm_SingleSubmitted;
            }

            await BaseCommonServices.DialogService.ShowInformationAsync($"{e.Result.Cast<TestItem>().Single().Description} selected.");
        }
예제 #8
0
        protected virtual void OnSubmit(SubmitEventArgs e)
        {
            var h = Submit;

            if (h != null)
            {
                h(this, e);
            }
        }
예제 #9
0
        private void Submit(object sender, SubmitEventArgs e)
        {
            var h = waitHandle;

            if (h != null)
            {
                line = e.Text;
                h.Set();
            }
        }
예제 #10
0
        /// <summary>
        /// Selections the vm multiple submitted.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private async void SelectionVm_MultipleSubmitted(object sender, SubmitEventArgs <List <object> > e)
        {
            if (sender is SelectionViewModel <TestItem> vm)
            {
                vm.Submitted -= SelectionVm_MultipleSubmitted;
            }

            SelectedTestItems = new ObservableCollection <TestItem>(e.Result.Cast <TestItem>());

            await BaseCommonServices.DialogService.ShowInformationAsync($"{string.Join(", ", e.Result.Cast<TestItem>().Select(s => s.Description))} selected.");
        }
예제 #11
0
 /// <summary>
 /// Called when [submitted].
 /// </summary>
 /// <param name="e">The e.</param>
 protected override void OnSubmitted(SubmitEventArgs <string> e)
 {
     if (!string.IsNullOrEmpty(_targetProperty))
     {
         base.OnSubmitted(new SubmitEventArgs <string>(e.Owner, e.Result, _targetProperty));
     }
     else
     {
         base.OnSubmitted(e);
     }
 }
예제 #12
0
        public void Submit(Guid workflowId, Guid objectId, string upn, ExtensibleDC submittedObject)
        {
            SubmitEventArgs args = new SubmitEventArgs(workflowId, objectId, upn, submittedObject);

            args.Identity = upn;
            EventHandler <SubmitEventArgs> eventHandler = Submitted;

            if (eventHandler != null)
            {
                eventHandler(null, args);
            }
        }
예제 #13
0
        /// <summary>
        /// UDGSettingWestPanelSubmitNodes
        /// </summary>
        protected void UDGSettingWestPanelSubmitNodes(object sender, SubmitEventArgs e)
        {
            try {
                var lscId     = LscID;
                var udGroupID = UDGroupID;
                var lscEntity = new BLsc();
                var lsc       = lscEntity.GetLsc(lscId);
                if (lsc == null)
                {
                    WebUtility.ShowNotify(EnmErrType.Warning, "无法获取客户端信息,数据保存失败!");
                    return;
                }

                var userData = UserData;
                var lscUser  = userData.LscUsers.Find(lu => { return(lu.LscID == lsc.LscID); });
                if (lscUser == null)
                {
                    WebUtility.ShowNotify(EnmErrType.Warning, "无法获取用户信息,数据保存失败!");
                    return;
                }

                var cacheKey = WebUtility.GetCacheKeyName(userData, "udg-setting-devs");
                var devNodes = HttpRuntime.Cache[cacheKey] as List <GroupTreeInfo>;
                if (devNodes == null)
                {
                    WebUtility.ShowNotify(EnmErrType.Warning, "无法获取关联设备,数据保存失败!");
                    return;
                }

                var group = new UDGroupInfo();
                group.LscID        = lscId;
                group.UserID       = lscUser.UserID;
                group.UDGroupID    = udGroupID;
                group.UDGroupName  = UDGroupName.Text;
                group.UDGroupNodes = new List <UDGroupTreeInfo>();
                group.Enabled      = true;
                AddUDGSettingWestPanelSubmitNodes(devNodes, group, e.RootNode);

                var    groupEntity      = new BGroup();
                string connectionString = WebUtility.CreateLscConnectionString(lsc);
                group = groupEntity.SaveLSCUDGroupTreeNodes(connectionString, group);
                groupEntity.SaveCSCUDGroupTreeNodes(group);
                lscUser.UDGroups.RemoveAll(udg => { return(udg.UDGroupID == group.UDGroupID); });
                lscUser.UDGroups.Add(group);
                UDGroupID = group.UDGroupID;
                WebUtility.ShowNotify(EnmErrType.Info, "数据已保存成功!");
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
예제 #14
0
        bool TrySubmit()
        {
            var e = new SubmitEventArgs(_text.Content);

            if (OnSubmit != null)
            {
                OnSubmit(this, e);
            }
            if (e.Handled)
            {
                _submitDesired = false;
            }
            return(e.Handled);
        }
        //提交按钮
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            List <DrugInfo> l = new List <DrugInfo>();

            foreach (var c in addBL)
            {
                l.Add(c);
            }
            SubmitEventArgs args = new SubmitEventArgs(l);

            onSubmit(args);
            this.Dispose();
        }
예제 #16
0
        /// <summary>
        /// Submit Nodes
        /// </summary>
        protected void SubmitNodes(object sender, SubmitEventArgs e)
        {
            try {
                var lscEntity           = new BLsc();
                var lscs                = lscEntity.GetLscs();
                var reportSettingEntity = new BSetting();
                var userData            = UserData;
                foreach (var sNode in e.RootNode.Children)
                {
                    var lsc = lscs.Find(l => { return(l.LscID.ToString().Equals(sNode.NodeID)); });
                    if (lsc == null)
                    {
                        continue;
                    }
                    var lscUser = userData.LscUsers.Find(lu => { return(lu.LscID == lsc.LscID); });
                    if (lscUser == null)
                    {
                        continue;
                    }

                    var sp = new SpeechInfo();
                    sp.SpDisconnect = Boolean.Parse(sNode.Attributes["SpDisconnect"].ToString());
                    sp.AL1Enabled   = Boolean.Parse(sNode.Attributes["AL1Enabled"].ToString());
                    sp.AL2Enabled   = Boolean.Parse(sNode.Attributes["AL2Enabled"].ToString());
                    sp.AL3Enabled   = Boolean.Parse(sNode.Attributes["AL3Enabled"].ToString());
                    sp.AL4Enabled   = Boolean.Parse(sNode.Attributes["AL4Enabled"].ToString());
                    sp.SpDevFilter  = sNode.Attributes["SpDevFilter"].ToString();
                    sp.SpNodeFilter = sNode.Attributes["SpNodeFilter"].ToString();
                    sp.SpLoop       = Boolean.Parse(sNode.Attributes["SpLoop"].ToString());
                    sp.SpArea2      = Boolean.Parse(sNode.Attributes["SpArea2"].ToString());
                    sp.SpArea3      = Boolean.Parse(sNode.Attributes["SpArea3"].ToString());
                    sp.SpStation    = Boolean.Parse(sNode.Attributes["SpStation"].ToString());
                    sp.SpDevice     = Boolean.Parse(sNode.Attributes["SpDevice"].ToString());
                    sp.SpNode       = Boolean.Parse(sNode.Attributes["SpNode"].ToString());
                    sp.SpALDesc     = Boolean.Parse(sNode.Attributes["SpALDesc"].ToString());
                    sp.UpdateTime   = DateTime.Now;

                    var connectionString = WebUtility.CreateLscConnectionString(lsc);
                    var localSpeech      = reportSettingEntity.UpdateLSCSpeechFilter(connectionString, sNode.Attributes["SpUID"].ToString(), sp);
                    reportSettingEntity.UpdateCSCSpeechFilter(lsc.LscID, sNode.Attributes["SpUID"].ToString(), sp);
                    lscUser.AlarmSoundFiterItem = sp;
                }
                WebUtility.ShowNotify(EnmErrType.Info, "数据已保存成功!");
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            }
        }
예제 #17
0
        private void _treePanelRight_Submit(object sender, SubmitEventArgs e)
        {
            List <SubmittedNode> children = e.RootNode.Children;

            foreach (SubmittedNode node in children)
            {
                Ext.Net.Node node2 = new Ext.Net.Node
                {
                    NodeID = node.NodeID,
                    Text   = node.Text,
                    Leaf   = true
                };
                this._treePanelLeft.GetRootNode().InsertChild(0, node2);
                this._treePanelRight.GetNodeById(node.NodeID).Remove();
                this._selectedIds.Remove(ConvertHelper.ToInt32(node.NodeID));
            }
        }
예제 #18
0
        private void HandleSubmitEvent_Invoked(object sender, ExternalDataEventArgs e)
        {
            SubmitEventArgs args            = (SubmitEventArgs)e;
            ExtensibleDC    submittedObject = args.SubmittedObject;

            if (submittedObject == null || string.IsNullOrEmpty(FieldName) || string.IsNullOrEmpty(FieldValue))
            {
                _autoApprove = false;
                return;
            }
            string value = submittedObject.GetValue(FieldName);

            if (string.Compare(value, FieldValue, true) == 0)
            {
                _autoApprove = true;
                _pass        = true;
            }
        }
예제 #19
0
 private void ValidateTitle(SubmitEventArgs <string> eventArgs)
 {
     eventArgs.Cancel = true;
     if (eventArgs.Value == "")
     {
         MessageBox.Show("Note name can't be empty", "Invalid name", MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else if (NotesManager.HasNote(eventArgs.Value))
     {
         MessageBox.Show("A note with this name already exists.", "Invalid name", MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else if (FileUtils.IsInvalidFileName(eventArgs.Value))
     {
         MessageBox.Show("Note name must be a valid filename.", "Invalid name", MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else
     {
         eventArgs.Cancel = false;
     }
 }
예제 #20
0
        } // 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");
        }
 /// <summary>
 /// Called when [submitted].
 /// </summary>
 /// <param name="e">The e.</param>
 protected virtual void OnSubmitted(SubmitEventArgs <TEntity> e) => Submitted?.Invoke(this, e);
 protected virtual async Task RunSubmit(SubmitEventArgs eventArgs)
 {
     await SubmitActionHandler.Handle(eventArgs, SubmitHandler, null);
 }
예제 #23
0
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            var n = NoMod(e);

            if (n && e.KeyCode == Keys.Left && InPos())
            {
                sci.Keyboard.ExecuteCommand(SciCommand.CharLeft);
            }
            else if (n && e.KeyCode == Keys.Right)
            {
                sci.Keyboard.ExecuteCommand(SciCommand.CharRight);
            }
            else if (n && e.KeyCode == Keys.Up && InPosLine())
            {
                ReplaceIf(history.Previous());
            }
            else if (n && e.KeyCode == Keys.Down && InPosLine())
            {
                ReplaceIf(history.Next());
            }
            else if (n && e.KeyCode == Keys.Insert)
            {
                sci.Overtype = !sci.Overtype;
            }
            else if (n && e.KeyCode == Keys.Return)
            {
                var s = sci.GetSelection();

                if (s.Start != s.End)
                {
                    sci.Copy();
                    sci.ClearSelections();
                    sci.CaretPosition = sci.GetTextLength();
                }
                else
                {
                    sci.CaretPosition = sci.GetTextLength();
                    var line = GetLine(sci.CurrentLine);
                    history.Add(line.Trim('\0'));
                    var ev = new SubmitEventArgs(line);
                    PrintLine();
                    OnSubmit(ev);
                }
            }
            else if (n && e.KeyCode == Keys.Back && InPos())
            {
                sci.Keyboard.ExecuteCommand(SciCommand.DeleteBack);
            }
            else if (n && e.KeyCode == Keys.Delete && InPosRelax())
            {
                sci.ReplaceText(sci.CurrentPosition, sci.CurrentPosition + 1, String.Empty);
            }
            else if (n && e.KeyCode == Keys.Home && InPos())
            {
                sci.CaretPosition = sci.GetPositionFromLine(sci.LineCount - 1) + lastLen;
            }
            else if (n && (sci.CurrentLine != sci.LineCount - 1 || sci.GetColumnFromPosition(sci.CurrentPosition) < lastLen))
            {
                e.SuppressKeyPress = true;
            }
            else if (n && e.KeyCode == Keys.Escape)
            {
                Replace(String.Empty);
            }
            else if (e.Shift && !e.Alt && !e.Control && e.KeyCode == Keys.Left && InPos())
            {
                sci.Keyboard.ExecuteCommand(SciCommand.CharLeftExtend);
            }
            else if (e.Shift && !e.Alt && !e.Control && e.KeyCode == Keys.Right)
            {
                sci.Keyboard.ExecuteCommand(SciCommand.CharRightExtend);
            }
            else if (e.Control && !e.Alt && !e.Shift && e.KeyCode == Keys.Right)
            {
                sci.WordRight();
            }
            else if (e.Control && !e.Alt && !e.Shift && e.KeyCode == Keys.Left && sci.GetColumnFromPosition(sci.CurrentPosition) > lastLen)
            {
                sci.WordLeft();
            }
        }
예제 #24
0
        public void FormEvents_Submit(object sender, SubmitEventArgs e)
        {
            // If the submit operation is successful, set
            // e.CancelableArgs.Cancel = false;
            // Write your code here.
            try
            {

                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");
        }
예제 #25
0
 private void Submit(object sender, SubmitEventArgs e)
 {
     RunCode(e.Text);
 }