Exemple #1
0
        private void loginClicked(object sender, EventArgs e)
        {
            IDPassWord = new String[] { textBox_ID.Text, textBox_PassWord.Text };
            SQLITE sq = new SQLITE("TestSystem");

            sq.TableName = "IDAndPassword";

            if (textBox_ID.Text != "" && textBox_PassWord.Text != "")
            {
                if (textBox_PassWord.Text == sq.selectData(IDPassWord))
                {
                    this.Close();
                    //VCI_CloseDevice(Can.m_devtype, Can.m_devind);
                    paForm.Close();
                    formPeizhi = new FormPeizhi(formName);
                    formPeizhi.Show();

                    //new Thread(() => Application.Run(new FormZuhebanPeizhi())).Start();
                }
                else
                {
                    this.label1.Text = "账号或密码不正确";
                }
            }
            else
            {
                this.label1.Text = "账号或密码不能为空";
            }
        }
Exemple #2
0
        private void changeOKButton_Click(object sender, EventArgs e)
        {
            IDPassWord = new String[] { changePasswordIDTextbox.Text, changePasswordOldTextbox.Text };
            SQLITE sq = new SQLITE("TestSystem");

            sq.TableName = "IDAndPassword";

            if (changePasswordIDTextbox.Text != "" && changePasswordOldTextbox.Text != "" && changePasswordNewTextbox.Text != "")
            {
                if (changePasswordOldTextbox.Text == sq.selectData(IDPassWord))
                {
                    sq.updateData(IDPassWord, changePasswordNewTextbox.Text);
                    changePasswordLabel.Text = "修改完成";
                }
                else
                {
                    changePasswordLabel.Text = "账号或密码不正确";
                }
            }
            else
            {
                changePasswordLabel.Text = "账号或密码不能为空";
            }
        }
Exemple #3
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            G.localMain = this.Location;
            Form1       = new Form1();
            if (cbMod.SelectedIndex == 1)
            {
                if (cbProgram.SelectedIndex == cbProgram.Items.Count - 1)
                {
                    Browser = new Browser(this.Form1);
                    Browser.ShowDialog();
                }
                else
                {
                    try
                    {
                        string[] files = System.IO.Directory.GetFiles(G.pathSQL + "\\DATA", " *.sfs");
                    }
                    catch (Exception)
                    {
                        X :        DialogResult dialogResult1 = MessageBox.Show("Dự án :" + G.editTile + Environment.NewLine + "Không tồn tại với đường link :" + G.pathSQL + Environment.NewLine
                                                                                + "Bạn muốn thay đổi đường dẫn khác ?", "Editor", MessageBoxButtons.YesNo);
                        if (dialogResult1 == DialogResult.Yes)
                        {
                            FolderBrowserDialog OpenPJ = new FolderBrowserDialog();

                            OpenPJ.ShowNewFolderButton = true;

                            DialogResult result = OpenPJ.ShowDialog();

                            if (result == DialogResult.OK)
                            {
                                G.pathSQL = OpenPJ.SelectedPath;
                                try
                                {
                                    string[] files = System.IO.Directory.GetFiles(G.pathSQL + "\\DATA.sfs");
                                }
                                catch (Exception)
                                {
                                    goto X;
                                }
                                Dictionary <string, string> dic = new Dictionary <string, string>();
                                dic.Add("PATH", G.pathSQL);
                                SQLITE.Update("INFOR", dic, "NAME='" + G.editTile + "'", G.defautSQL);
                            }

                            Computer comp = new Computer();

                            DialogResult dialogResult = MessageBox.Show("Bạn muốn Sửa chương trình", "Editor", MessageBoxButtons.YesNo);
                            if (dialogResult == DialogResult.Yes)
                            {
                                try
                                {
                                    // System.IO.File.Delete("SQL\\Data.sqlite");
                                    System.IO.File.Delete("SQL\\TOOL.sfs");
                                    System.IO.File.Delete("SQL\\CHART.sfs");
                                    System.IO.File.Delete("SQL\\DATA.sfs");
                                    System.IO.File.Delete("SQL\\Variables.sfs");
                                }
                                catch (Exception)
                                {
                                }
                                comp.FileSystem.CopyFile(G.pathSQL + "\\DATA.sfs", "SQL\\DATA.sfs", UIOption.AllDialogs, UICancelOption.DoNothing);
                                comp.FileSystem.CopyFile(G.pathSQL + "\\TOOL.sfs", "SQL\\TOOL.sfs", UIOption.AllDialogs, UICancelOption.DoNothing);
                                comp.FileSystem.CopyFile(G.pathSQL + "\\CHART.sfs", "SQL\\CHART.sfs", UIOption.AllDialogs, UICancelOption.DoNothing);
                                comp.FileSystem.CopyFile(G.pathSQL + "\\Variables.sfs", "SQL\\Variables.sfs", UIOption.AllDialogs, UICancelOption.DoNothing);

                                Form1.Show();
                            }
                        }
                    }
                }
            }
            else
            {
                LoadSQL = new LoadSQL();
                G.Shift = cbShift.SelectedIndex;
                Graphic.ShowDialog();
            }

            // this.Hide();
        }
 internal void ptrmapPut(Pgno key, PTRMAP eType, Pgno parent, ref SQLITE pRC)
 {
     pRC = SQLITE.OK;
 }
 internal void ptrmapPut(Pgno key, PTRMAP eType, Pgno parent, ref SQLITE pRC)
 {
     pRC = SQLITE.OK;
 }