/// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">e</param>
        private void Delete(object sender, RoutedEventArgs e)
        {
            ResponseMessage result = new ResponseMessage();

            if (loginUser.UserType > -1 && System.Windows.Forms.MessageBox.Show("确认删除选中数据?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                foreach (var i in pipingInfoData.SelectedItems)
                {
                    PipingInfo delectionInfo = i as PipingInfo;
                    if (delectionInfo != null)
                    {
                        result = service.Delete(loginUser.UserName, delectionInfo.PipingID);
                        if (result.code == "0")
                        {
                            pipingInfoData.ItemsSource = service.Search(loginUser.UserName, new SearchRequst()).ext;
                            LoadComboBox(sender, e);
                        }
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("请先选择一条数据!");
                    }
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("请先登录!");
            }
        }
Ejemplo n.º 2
0
        public ResponseMessage Delete(string usertoken, string pipingid)
        {
            ResponseMessage result = new ResponseMessage();

            //验证token
            result = service.Delete(usertoken, pipingid);
            return(result);
        }