示例#1
0
        private void NetworkSave()
        {
            bool verify = true;

            for (int i = 0; i < Ipsite.Count; i++)
            {
                if (!FormatVerification.HasIP(Ipsite[i].Text.Trim()) || !FormatVerification.IsFloat(PortData[i].Text.Trim()))
                {
                    verify = false;
                }
            }
            if (verify)
            {
                if (mapMessage.SavenetworkBLL(MapRegulate.UTCTime, Ipsite.Select(p => p.Text.Trim()).ToList(), PortData.Select(p => p.Text.Trim()).ToList()))
                {
                    MessageBox.Show("保存成功!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("保存失败!", "提示", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            else
            {
                MessageBox.Show("格式输入错误!", "提示", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }