Exemplo n.º 1
0
    /// <summary>
    /// 增加
    /// </summary>
    public void add()
    {
        System.Text.StringBuilder list = new System.Text.StringBuilder();
        DataSet ds = new DataSet1();
        ds.ReadXml(Server.MapPath("work.xml"));
        DataRow row = ds.Tables[0].NewRow();
        row["cname"] = Request.QueryString["cname"];
        row["cmoney"] = Request.QueryString["cmoney"];
        row["mark"] = Request.QueryString["mark"];
        ds.Tables[0].Rows.Add(row);
        ds.WriteXml(Server.MapPath("work.xml"));

        DataSet dss = new DataSet1();
        dss.ReadXml(Server.MapPath("work.xml"));
        int ircount = dss.Tables[0].Rows.Count;
        int maxid = 0;

        for (int i = 0; i < ircount; i++)
        {
            if (Convert.ToInt32(dss.Tables[0].Rows[i][0]) > maxid)
            {
                maxid = Convert.ToInt32(dss.Tables[0].Rows[i][0]);
            }
        }
        list.Append("<tr id='d" + maxid + "'>");
        list.Append("<td><a href='javascript:del(" + maxid.ToString() + ")'>删除</a></td>");
        list.Append("<td>"+Request.QueryString["cname"]+"</td>");
        list.Append("<td>" + Request.QueryString["cmoney"] + "</td>");
        list.Append("<td>" + Request.QueryString["mark"] + "</td></tr>");
        Response.Write(list.ToString());
        Response.End();
    }
Exemplo n.º 2
0
 private void открытьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         if (DataSet1.Tables[0].Rows.Count > 0)
         {
             DataSet1.Clear();
         }
         DataSet1.ReadXml(openFileDialog1.FileName);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Загрузить из файла
 /// </summary>
 /// <param name="fileName">Имя файла, из которого загружаем</param>
 private void OpenProject(string fileName)
 {
     try
     {
         fData.Clear();
         // Грузим  в DataSet
         fData.ReadXml(fileName);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ошибка в формате загружаемого файла.", "Ошибка",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Required code
        this.ReportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence);
        this.ReportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("Barcode, Version=1.0.5.40001, Culture=neutral, PublicKeyToken=6dc438ab78a525b3");
        this.ReportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");

        // Data load
        DataSet1 dataSet = new DataSet1();
        dataSet.ReadXml(Server.MapPath("~/App_Data/Products.xml"));

        ReportDataSource dataSource = new ReportDataSource("DataSet1_Products", dataSet.Products);
        this.ReportViewer1.LocalReport.DataSources.Add(dataSource);
        this.ReportViewer1.LocalReport.Refresh();
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Required code
        this.ReportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence);
        this.ReportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("Barcode, Version=2.0.0.20, Culture=neutral, PublicKeyToken=6dc438ab78a525b3");
        this.ReportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");

        // Data load
        DataSet1 dataSet = new DataSet1();

        dataSet.ReadXml(Server.MapPath("~/App_Data/Products.xml"));

        ReportDataSource dataSource = new ReportDataSource("DataSet1_Products", dataSet.Products);

        this.ReportViewer1.LocalReport.DataSources.Add(dataSource);
        this.ReportViewer1.LocalReport.Refresh();
    }
Exemplo n.º 6
0
        public void Start()
        {
            if (System.IO.File.Exists(fileName))
            {
                dataSet.ReadXml(fileName);
            }

            //今日の日付を yyyy/mm/dd の形式で保持
            Form1Data.date = DateTime.Today.ToShortDateString();

            //選択された日付の日記を探すメソッドを呼び出す
            FindDiary();
            FindMoneyData();

            //支出合計を TextBox に表示させる
            //以下、全データの合計を取得
            //Form1Data.moneySumTextBoxText = moneyDataTable.Compute("Sum(金額)", null).ToString();

            FindMonthMoneyData();
            FindMonthDiary();
        }
Exemplo n.º 7
0
 private void Form1_Load(object sender, EventArgs e)
 {
     if (File.Exists(FileName))
     {
         dataSet1.ReadXml(FileName);
         dataGridView1.DataSource = dataSet1.Tables["ServerTypes"].DefaultView;
         dataGridView2.DataSource = dataSet1.Tables["Connections"].DefaultView;
         dataGridView2.Rows[0].Cells[0].Selected = true;
         DV1 = new DataView(dataSet1.Tables["Tables"]);
         DV2 = new DataView(dataSet1.Tables["Fields"]);
         DV3 = new DataView(dataSet1.Tables["Table_Field_Path"]);
         DV4 = new DataView(dataSet1.Tables["Paths"]);
         dataGridView3.DataSource = DV1;
         dataGridView4.DataSource = DV2;
         dataGridView5.DataSource = DV3;
         dataGridView6.DataSource = DV4;
     }
     if (File.Exists(ms_sql_table_stars_script_FileName))
     {
         richTextBox2.LoadFile(ms_sql_table_stars_script_FileName, RichTextBoxStreamType.PlainText);
     }
 }
        public Form1()
        {
            InitializeComponent();

            dataset = new DataSet1();

            try
            {
                dataset.ReadXml("Playlists.xml");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            TotalDuration = new TimeSpan(0, 0, 0);
            myTimer       = new Timer();

            myTimer.Tick    += new EventHandler(timer1_Tick); // Everytime timer ticks, timer_Tick will be called
            myTimer.Interval = (1) * (1000);                  // Timer will tick evert second
            //myTimer.Enabled = true;                       // Enable the timer
            //myTimer.Start();                              // Start the timer
            newPlaylistCreated = false;
        }
Exemplo n.º 9
0
        //загрузка
        private void open(object sender, RoutedEventArgs e)
        {
            set.Clear();
            list.Items.Clear();
            loading = true;
            OpenFileDialog f = new OpenFileDialog
            {
                Filter       = "xml|*.xml",
                AddExtension = true,
                DefaultExt   = "xml"
            };

            try
            {
                if (MessageBox.Show("Открытие новой базы данных приведет к закрытию всех окон кроме главного\nПродолжить?",
                                    "Открытие файла", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
                {
                    loading = false;
                    return;
                }
                f.ShowDialog();
                Stream xml = File.OpenRead(f.FileName);
                set.ReadXml(xml);
                xml.Close();
                foreach (Window w in OwnedWindows)
                {
                    w.Close();
                }
            }
            catch (Exception E)
            {
                MessageBox.Show(E.Message);
            }
            loading = false;
            W.refresh();
        }
        public Form1()
        {
            InitializeComponent();

            dataset = new DataSet1();

            try
            {
                dataset.ReadXml("Playlists.xml");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            TotalDuration = new TimeSpan(0, 0, 0);
            myTimer = new Timer();

            myTimer.Tick += new EventHandler(timer1_Tick); // Everytime timer ticks, timer_Tick will be called
            myTimer.Interval = (1) * (1000);              // Timer will tick evert second
            //myTimer.Enabled = true;                       // Enable the timer
            //myTimer.Start();                              // Start the timer
            newPlaylistCreated = false;
        }
Exemplo n.º 11
0
        private void configDataSetLoad()
        {
            try {
                if (!System.IO.File.Exists("config.xml"))
                {
                    newConfig();
                }
                else
                {
                    ds.ReadXml("./config.xml");

                    if (ds.Tables.Count != 2)
                    {
                        newConfig();
                    }
                    if (ds.DataTable2.Rows.Count != 1)
                    {
                        newConfig();
                    }
                    if (ds.DataTable2.Rows[0][ds.DataTable2.versionColumn.ColumnName].ToString() != datasetVersion)
                    {
                        newConfig();
                    }

                    ds.WriteXml("./config.xml");
                }

                bs.DataSource = ds.DataTable1;

                cmbKonfiguration.DataSource    = ds.DataTable1.DefaultView;
                cmbKonfiguration.DisplayMember = ds.DataTable1.ConfigNameColumn.ColumnName;
                cmbKonfiguration.SelectedIndex = 0;

                this.rbBandit.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.BanditColumn.ColumnName, true));
                this.rbPlayer.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.PlayerColumn.ColumnName, true));

                this.txtAngreiferName.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AttackerColumn.ColumnName, true));
                this.txtDefenderName.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.DefenderNameColumn.ColumnName, true));
                this.txtBanditName.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.BanditNameColumn.ColumnName, true));

                //Attacker 1
                this.txtAR1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AR1Column.ColumnName, true));
                this.txtAB1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AB1Column.ColumnName, true));
                this.txtAM1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AM1Column.ColumnName, true));
                this.txtAC1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AC1Column.ColumnName, true));
                this.txtAS1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AS1Column.ColumnName, true));
                this.txtAE1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AE1Column.ColumnName, true));
                this.txtAL1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AL1Column.ColumnName, true));
                this.txtAA1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AA1Column.ColumnName, true));
                this.txtAK1.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AK1Column.ColumnName, true));
                //Attacker 2
                this.chkG2.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.AG2Column.ColumnName, true));
                this.txtAR2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AR2Column.ColumnName, true));
                this.txtAB2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AB2Column.ColumnName, true));
                this.txtAM2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AM2Column.ColumnName, true));
                this.txtAC2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AC2Column.ColumnName, true));
                this.txtAS2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AS2Column.ColumnName, true));
                this.txtAE2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AE2Column.ColumnName, true));
                this.txtAL2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AL2Column.ColumnName, true));
                this.txtAA2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AA2Column.ColumnName, true));
                this.txtAK2.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AK2Column.ColumnName, true));
                //Attacker 3
                this.chkG3.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.AG3Column.ColumnName, true));
                this.txtAR3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AR3Column.ColumnName, true));
                this.txtAB3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AB3Column.ColumnName, true));
                this.txtAM3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AM3Column.ColumnName, true));
                this.txtAC3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AC3Column.ColumnName, true));
                this.txtAS3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AS3Column.ColumnName, true));
                this.txtAE3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AE3Column.ColumnName, true));
                this.txtAL3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AL3Column.ColumnName, true));
                this.txtAA3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AA3Column.ColumnName, true));
                this.txtAK3.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AK3Column.ColumnName, true));
                //Defender - Player
                this.chkDG.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.DGColumn.ColumnName, true));
                this.txtDR.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AR3Column.ColumnName, true));
                this.txtDB.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AB3Column.ColumnName, true));
                this.txtDM.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AM3Column.ColumnName, true));
                this.txtDC.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AC3Column.ColumnName, true));
                this.txtDS.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AS3Column.ColumnName, true));
                this.txtDE.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AE3Column.ColumnName, true));
                this.txtDL.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AL3Column.ColumnName, true));
                this.txtDA.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AA3Column.ColumnName, true));
                this.txtDK.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.AK3Column.ColumnName, true));
                this.chkDT.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.DTColumn.ColumnName, true));
                //Defender - Bandit
                this.txtPL.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.PLColumn.ColumnName, true));
                this.txtSL.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.SLColumn.ColumnName, true));
                this.txtWH.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.WHColumn.ColumnName, true));
                this.txtRB.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.RBColumn.ColumnName, true));
                this.txtSW.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.SWColumn.ColumnName, true));
                this.txtWL.DataBindings.Add(new Binding("Text", this.bs, ds.DataTable1.WLColumn.ColumnName, true));
                this.chkBT.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.BTColumn.ColumnName, true));

                this.rbKeinBoss.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.noBossColumn.ColumnName, true));
                this.rbST.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.STColumn.ColumnName, true));
                this.rbEB.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.EBColumn.ColumnName, true));
                this.rbCK.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.CKColumn.ColumnName, true));
                this.rbMG.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.MGColumn.ColumnName, true));
                this.rbDWW.DataBindings.Add(new Binding("Checked", this.bs, ds.DataTable1.DWWColumn.ColumnName, true));
            } catch (Exception ex) {
                webbrowser(ex.Message);
            }
        }