static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            BonusSkins.Register();
            //Application.Run(new frmFeedback());
            if (new frm_ChangeServer().ShowDialog() != DialogResult.OK)
            {
                return;
            }
            bool temp = false;

            do
            {
                temp = false;
                frmLogin frLogin = new frmLogin();

                if (frLogin.ShowDialog() == DialogResult.OK)
                {
                    frm_Main frMain = new frm_Main();

                    if (frMain.ShowDialog() == DialogResult.Yes)
                    {
                        frMain.Close();
                        temp = true;
                    }
                }
            }while (temp);
        }
示例#2
0
文件: Program.cs 项目: hcroyal/NenCho
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new frm_Main());
            bool temp;

            do
            {
                temp = false;
                Frm_Login a = new Frm_Login();
                a.lb_programName.Text = "          Chương trình\n        Nencho";
                a.lb_version.Text     = @"1.0";
                a.UrlUpdateVersion    = @"\\10.10.10.254\DE_Viet\2016\PHIẾU KIỂM ĐỊNH\Tool";
                a.LoginEvent         += a_LoginEvent;
                a.ButtonLoginEven    += a_ButtonLoginEven;
                if (a.ShowDialog() == DialogResult.OK)
                {
                    Global.StrMachine    = a.StrMachine;
                    Global.StrUserWindow = a.StrUserWindow;
                    Global.StrIpAddress  = a.StrIpAddress;
                    Global.StrUsername   = a.StrUserName;
                    Global.StrBatch      = a.StrBatch;
                    Global.StrRole       = a.StrRole;
                    Global.Strtoken      = a.Token;
                    frm_Main frMain = new frm_Main();

                    if (frMain.ShowDialog() == DialogResult.Yes)
                    {
                        frMain.Close();
                        temp = true;
                    }
                }
            }while (temp);
        }
示例#3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            BonusSkins.Register();
            SkinManager.EnableFormSkins();
            UserLookAndFeel.Default.SetSkinStyle("DevExpress Style");
            //Application.Run(new FrmTienDo());
            if (new frm_ChangeServer().ShowDialog() != DialogResult.OK)
            {
                return;
            }
            bool temp = false;

            do
            {
                temp = false;

                frmLogin frLogin = new frmLogin();
                if (frLogin.ShowDialog() == DialogResult.OK)
                {
                    frm_Main frMain = new frm_Main();

                    if (frMain.ShowDialog() == DialogResult.Yes)
                    {
                        frMain.Close();
                        temp = true;
                    }
                }
            }while (temp);
        }
示例#4
0
 private void btn_Login_Click(object sender, EventArgs e)
 {
     // Role Id Reffers either a user is a customer or Chef
     if (cmb_RoleID.SelectedIndex < 0)
     {
         MessageBox.Show("Please Select Role", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         Main.RoleID = int.Parse(cmb_RoleID.SelectedValue.ToString());
         if (txt_Username.Text != "")
         {
             if (txt_Password.Text != "")
             {
                 if (Main.CheckUserName(txt_Username.Text) == true)
                 {
                     if (Main.checkPassword(txt_Username.Text, txt_Password.Text) == true)
                     {
                         Main.UserName = txt_Username.Text;
                         // I will get the UserID coresponding to the user name from the database
                         String sUserId = SQL.ScalarQuery("Select L_ID from login where L_Username = '******'");
                         int    id;
                         //Since the id is an int a simple test is performed to convert the string to int
                         if (int.TryParse(sUserId, out id))
                         {
                             Main.UserID = id;
                         }
                         // The login form will disappear
                         this.Hide();
                         // Main form (Home) will appear
                         var NEW = new frm_Main();
                         NEW.ShowDialog();
                     }
                     else
                     {
                         MessageBox.Show("Invalid Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                     }
                 }
                 else
                 {
                     MessageBox.Show("Invalid Username", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                 }
             }
             else
             {
                 MessageBox.Show("Please Enter Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             }
         }
         else
         {
             MessageBox.Show("Please Enter UserName", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
     }
 }
示例#5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            BonusSkins.Register();
            SkinManager.EnableFormSkins();
            UserLookAndFeel.Default.SetSkinStyle("DevExpress Style");
            //Application.Run(new FrmTienDo());
            if (new frm_ChangeServer().ShowDialog() != DialogResult.OK)
            {
                return;
            }
            bool temp = false;

            do
            {
                temp = false;

                frmLogin frLogin = new frmLogin();
                if (frLogin.ShowDialog() == DialogResult.OK)
                {
                    if (Global.StrCity == "CityS")
                    {
                        BaoCaoLuonng2017.Global.StrMachine    = Global.StrPcName;
                        BaoCaoLuonng2017.Global.StrUserWindow = Global.StrDomainName;
                        BaoCaoLuonng2017.Global.StrIpAddress  = "";
                        BaoCaoLuonng2017.Global.StrUsername   = Global.StrUserName;
                        BaoCaoLuonng2017.Global.StrBatch      = Global.StrBatch;
                        BaoCaoLuonng2017.Global.StrRole       = Global.StrRole;
                        BaoCaoLuonng2017.Global.Strtoken      = Global.Token;
                        BaoCaoLuonng2017.Global.StrCity       = Global.StrCity;
                        BaoCaoLuonng2017.MyForm.frm_Main fm = new BaoCaoLuonng2017.MyForm.frm_Main();
                        if (fm.ShowDialog() == DialogResult.Yes)
                        {
                            fm.Close();
                            frLogin.txt_username_TextChanged(null, null);
                            temp = true;
                        }
                    }
                    else
                    {
                        frm_Main frMain = new frm_Main();
                        if (frMain.ShowDialog() == DialogResult.Yes)
                        {
                            frMain.Close();
                            temp = true;
                        }
                    }
                }
            }while (temp);
        }
示例#6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            BonusSkins.Register();
            SkinManager.EnableFormSkins();
            UserLookAndFeel.Default.SetSkinStyle("DevExpress Style");
            //Application.Run(new frm_CreateBatch());

            bool temp;

            do
            {
                temp = false;
                Frm_Login a = new Frm_Login();
                a.lb_programName.Text = "\n           Dự Án JEMS";
                a.lb_vision.Text      = "Phiên bản :";
                a.grb_1.Text          = "Thông Tin PC";
                a.lb_machine.Text     = "Tên PC :";
                a.lb_user_window.Text = "Tài khoản window:";
                a.lb_ip.Text          = "Địa chỉ IP :";
                a.grb_2.Text          = "Thông Tin Tài Khoản Đăng Nhập";
                a.lb_username.Text    = "Tên đăng nhập :";
                a.lb_password.Text    = "Mật khẩu :";
                a.lb_role.Text        = "Vai trò :";
                a.lb_date.Text        = "Ngày: ";
                a.lb_time.Text        = "Giờ: ";
                a.lb_batchno.Text     = "BatchName: ";
                a.btn_thoat.Text      = "Thoát";
                a.chb_hienthi.Text    = "Hiển Thị";
                a.chb_luu.Text        = "Lưu";
                a.lb_version.Text     = @"1.2.7";
                a.UrlUpdateVersion    = @"\\10.10.10.254\DE_Viet\2017\JEMS\Tools";
                a.LoginEvent         += a_LoginEvent;
                a.ButtonLoginEven    += a_ButtonLoginEven;
                if (a.ShowDialog() == DialogResult.OK)
                {
                    Global.StrMachine    = a.StrMachine;
                    Global.StrUserWindow = a.StrUserWindow; Global.StrIpAddress = a.StrIpAddress;
                    Global.StrUsername   = a.StrUserName;
                    Global.StrBatch      = a.StrBatch;
                    Global.StrRole       = a.StrRole;
                    Global.Strtoken      = a.Token;
                    frm_Main f = new frm_Main();
                    if (f.ShowDialog() == DialogResult.Yes)
                    {
                        f.Close();
                        temp = true;
                    }
                }
            }while (temp);
        }
        private void btn_Login_Click(object sender, EventArgs e)
        {
            if (cmb_CompanyName.SelectedIndex < 0)
            {
                MessageBox.Show("Please Select Company", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                Main.CompanyID = int.Parse(cmb_CompanyName.SelectedValue.ToString());
                if (txt_Username.Text != "")
                {
                    if (txt_Password.Text != "")
                    {
                        if (Main.CheckUserName(txt_Username.Text) == true)
                        {
                            if (Main.checkPassword(txt_Username.Text, txt_Password.Text) == true)
                            {
                                Main.UserName = txt_Username.Text;

                                this.Hide();
                                var NEW = new frm_Main();
                                NEW.ShowDialog();
                            }
                            else
                            {
                                MessageBox.Show("Invalid Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Invalid Username", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please Enter Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
                else
                {
                    MessageBox.Show("Please Enter UserName", "Login", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
        }
示例#8
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            if (checkRemember.Checked)
            {
                Properties.Settings.Default.username = txt_user.Text;
                Properties.Settings.Default.password = txt_pass.Text;
                Properties.Settings.Default.Save();
            }
            else
            {
                Properties.Settings.Default.username = string.Empty;
                Properties.Settings.Default.password = string.Empty;
                Properties.Settings.Default.Save();
            }
            var username = txt_user.Text;
            var password = txt_pass.Text;

            if (username.Equals(""))
            {
                MessageBox.Show("Hãy Nhập Tài Khoản", "Thông Báo");
            }
            else if (password.Equals(""))
            {
                MessageBox.Show("Hãy Nhập Mật Khẩu", "Thông Báo");
            }
            else
            {
                string sql    = "select name from Account where username ='******' and password ='******'";
                var    result = db.DocBang(sql);
                if (result.Rows.Count > 0)
                {
                    this.Hide();
                    var      user = (string)result.Rows[0]["name"];
                    frm_Main frm  = new frm_Main(user);
                    frm.ShowDialog();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Tài khoản hoặc mật khẩu không đúng!!!", "Thông Báo");
                }
            }
        }
示例#9
0
        private void button_Select_Click(object sender, RoutedEventArgs e)
        {
            if (Patient_DataTable.Rows.Count > 0 && datagrid_Patient.SelectedIndex >= 0)
            {
                Patient_New.FileID     = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["FileID"].ToString();
                Patient_New.PatientID  = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["PatientID"].ToString();
                Patient_New.Name       = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["Name"].ToString();
                Patient_New.Birthday   = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["Birthday"].ToString();
                Patient_New.Sex        = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["Sex"].ToString();
                Patient_New.Address    = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["Address"].ToString();
                Patient_New.Tele       = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["Tele"].ToString();
                Patient_New.IdentifyID = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["IdentifyID"].ToString();
                Patient_New.Memo       = Patient_DataTable.Rows[datagrid_Patient.SelectedIndex]["Memo"].ToString();

                if (Record_DataTable.Rows.Count > 0)
                {
                    string sTmp = "";
                    Record_New = new MyData.CheckRecord_Struct[Record_DataTable.Rows.Count];
                    for (int i = 0; i < Record_DataTable.Rows.Count; i++)
                    {
                        Record_New[i].RecordID  = Record_DataTable.Rows[i]["RecordID"].ToString();
                        Record_New[i].FileID    = Record_DataTable.Rows[i]["FileID"].ToString();
                        Record_New[i].CheckTime = Record_DataTable.Rows[i]["CheckTime"].ToString();
                        Record_New[i].Doctor    = Record_DataTable.Rows[i]["Doctor"].ToString();
                        Record_New[i].CheckInfo = Record_DataTable.Rows[i]["CheckInfo"].ToString();

                        sTmp = System.Environment.CurrentDirectory + "\\Data\\" + Record_New[i].FileID.Trim() + "\\";
                        Record_New[i].SmallPict  = sTmp + "Small\\" + Record_DataTable.Rows[i]["SmallPict"].ToString();
                        Record_New[i].BigPict    = sTmp + "Big\\" + Record_DataTable.Rows[i]["BigPict"].ToString();
                        Record_New[i].SelectPict = "";
                    }

                    iSelectRecordID = int.Parse(Record_DataTable.Rows[datagrid_Record.SelectedIndex]["RecordID"].ToString());          // 选定的检查记录的RecordID
                }
                else
                {
                    Record_New = null;
                }

                IsSelectNew = true;

                if (IsShowInput)   // 从frm_Start调用
                {
                    pfrm_Start.Show();
                    pfrm_Start.IsEnabled     = true;
                    pfrm_Start.ShowInTaskbar = true;

                    this.Hide();
                }
                else       // 从frm_Start调用
                {
                    frm_Main Frm_Main = new frm_Main();
                    Frm_Main.IsFirst     = true;
                    Frm_Main.Patient_New = Patient_New;
                    Frm_Main.Record_New  = Record_New;
                    Frm_Main.pfrm_Search = this;

                    this.ShowInTaskbar = false;
                    pfrm_Start.Hide();
                    this.Hide();

                    Frm_Main.ShowDialog();
                }
            }
            else
            {
                Patient_New = new MyData.PatientInfo_Struct();
                Record_New  = null;
                IsSelectNew = false;
            }
        }