コード例 #1
0
ファイル: FormMain.cs プロジェクト: sergiygladkyy/Mriya
        private void buttonGetDALData_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime t1 = DateTime.Now;

                tableProfiles = UserProfilesDAL.Import1CUserProfiles.ImportRecords(
                    Properties.Settings.Default.soapServerUrl,
                    Properties.Settings.Default.soapServerUser,
                    Properties.Settings.Default.soapServerPassword
                    );
                dataGridViewABDal.DataSource = tableProfiles.GetProfiles();
                dataGridViewABDal.Refresh();

                DateTime t2 = DateTime.Now;
                labelABDalStatus.Text = string.Format("Received {0} records, t = {1:N2} sec",
                                                      tableProfiles.Count, (double)((t2 - t1).TotalMilliseconds / 1000));
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("The error was occured while importing data from {0}\nThe error message:{1}\n",
                                              Properties.Settings.Default.soapServerUrl, ex.Message), "Error!", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
コード例 #2
0
ファイル: FormMain.cs プロジェクト: sergiygladkyy/Mriya
        private void buttonGetDALData_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime t1 = DateTime.Now;

                tableProfiles = UserProfilesDAL.Import1CUserProfiles.ImportRecords(
                    Properties.Settings.Default.soapServerUrl,
                    Properties.Settings.Default.soapServerUser,
                    Properties.Settings.Default.soapServerPassword
                    );
                dataGridViewABDal.DataSource = tableProfiles.GetProfiles();
                dataGridViewABDal.Refresh();

                DateTime t2 = DateTime.Now;
                labelABDalStatus.Text = string.Format("Received {0} records, t = {1:N2} sec",
                    tableProfiles.Count, (double)((t2 - t1).TotalMilliseconds / 1000));
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("The error was occured while importing data from {0}\nThe error message:{1}\n",
                    Properties.Settings.Default.soapServerUrl, ex.Message), "Error!", MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }