Ejemplo n.º 1
0
        private void PurchaseForm_Load(object sender, EventArgs e)
        {
            this.Hide();

            try
            {
                logHelper = new LogHelper(Products.purchase);
            }
            catch (Exception ex)
            {
                Console.Write(ex);
                NotifyHelper.NotifyUser("��ʼ����־ģ��ʧ��, \r\n�����Կ�ʹ�ã�������¼��־");
            }

            string s = string.Format("{0} starts, version={1}",
                Application.ProductName, Application.ProductVersion);
            WriteLog(s);

            try
            {
                LoginForm l = new LoginForm(Properties.Settings.Default.DbConn, Products.purchase);
                if (l.ShowDialog() == DialogResult.OK)
                {
                    employeeID = l.EmpId;
                    this.Show();
                    Init();
                }
                else
                {
                    NotifyHelper.NotifyUser("��¼ʧ��, �����˳�");
                    this.Close();
                }
            }
            catch(Exception ex)
            {
                WriteLog(ex.ToString());
            }
        }
Ejemplo n.º 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     this.Hide();
     try
     {
         LoginForm l = new LoginForm(Properties.Settings.Default.DbConn, Products.pur);
         if (l.ShowDialog() == DialogResult.OK)
         {
             employeeID = l.EmpId;
             this.Show();
             Init();
         }
         else
         {
             NotifyHelper.NotifyUser("��¼ʧ��, �����˳�");
             this.Close();
         }
     }
     catch(Exception ex)
     {
     #warning log
         Console.Write(ex.Message);
     }
 }