예제 #1
0
        public SearchWithID()
        {
            InitializeComponent();
            ID_txt.Focus();

            WndConfig.setConfig4SimpleSearch(this);
        }
예제 #2
0
        private void Save_Btn_Click(object sender, EventArgs e)
        {
            List <Genree> List = new List <Genree>();

            for (int k = 0; k < Genree_lst.CheckedItems.Count; k++)
            {
                Genree list = new Genree(Genree_lst.CheckedItems[k].ToString());
                List.Add(list);
            }
            moVie.Save_Movie(FileNA_TXT.Text, EMovieTitle_txt.Text, ID_txt.Text, Title_txt.Text, Director_txt.Text, Year_cmbo.SelectedItem.ToString(), Rating_combo.SelectedItem.ToString(), List);
            MessageBox.Show("Edited Successfully :)", "Message", MessageBoxButtons.OK, MessageBoxIcon.None);
            FileNA_TXT.Clear();
            EMovieTitle_txt.Clear();
            ID_txt.Clear();
            Title_txt.Clear();
            Director_txt.Clear();
            Year_cmbo.Text    = "";
            Rating_combo.Text = "";
            bool state = false;

            for (int i = 0; i < Genree_lst.Items.Count; i++)
            {
                Genree_lst.SetItemCheckState(i, (state ? CheckState.Checked : CheckState.Unchecked));
            }
        }
예제 #3
0
 private void DoClear()
 {//Clear text box
     ID_txt.Clear();
     Name_txt.Clear();
     Price_txt.Clear();
     Qty_txt.ResetText();
 }
예제 #4
0
 /// <summary>
 /// 重置当前信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void bt_reset1_Click(object sender, EventArgs e)
 {
     ID_txt.Clear();
     name_txt.Clear();
     gender_txt1.Text = null;
     age_txt.Clear();
     class_txt.Clear();
     name_txt.Focus();
 }
 public void clear()
 {
     ID_txt.Clear();
     Name_txt.Clear();
     Age_txt.Clear();
     Location_txt.Clear();
     if (pictureBox1.Image != null)
     {
         pictureBox1.Image.Dispose();
         pictureBox1.Image = null;
     }
     Points_textBox.Clear();
 }
예제 #6
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            pnlSearch.Visible = true;
            pnlAdd.Visible    = false;
            pnlReport.Visible = false;

            ID_txt.Clear();
            metroListView1.Clear();
            idtxt.Clear();
            Passtxt.Clear();
            Fnametxt.Clear();
            Lnametxt.Clear();
        }
예제 #7
0
        private void A_add_btn_Click(object sender, EventArgs e)
        {
            Movie  m        = new Movie();
            string ID       = ID_txt.Text;
            string FileName = FileName_txt.Text;

            if (m.SearchUniquID(ID_txt.Text, FileName_txt.Text))
            {
                string        Title = Title_txt.Text;
                List <Genree> g     = new List <Genree>();
                for (int i = 0; i < Genre_lst.CheckedItems.Count; i++)
                {
                    Genree ge = new Genree(Genre_lst.CheckedItems[i].ToString());
                    g.Add(ge);
                }
                string Director = Director_txt.Text;
                string Year     = Year_cmbo.Text;
                string Rating   = Rating_combo.Text;

                string path = imageLocation;

                m.AddToExist(ID, Title, g, Director, Year, Rating, FileName, path);
                MessageBox.Show("Added Successfully ^_^", "File", MessageBoxButtons.OK, MessageBoxIcon.None);
                FileName_txt.Clear();
                ID_txt.Clear();
                Title_txt.Clear();
                Director_txt.Clear();
                Rating_combo.Text        = "";
                Year_cmbo.Text           = "";
                Poster_pic.ImageLocation = "";
                bool state = false;
                for (int j = 0; j < Genre_lst.CheckedItems.Count; j++)
                {
                    Genre_lst.SetItemCheckState(j, (state ? CheckState.Checked : CheckState.Unchecked));
                }
            }
            else
            {
                MessageBox.Show("You must enter a unique ID", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #8
0
        private void Add_Click(object sender, EventArgs e)
        {
            //if (emp.Verify_User_ID(User_ID.Text).Rows.Count == 0)
            //{
            try
            {
                emp.add_user(ID_txt.Text, Name_txt.Text, password_txt.Text, permission_combo.Text, Address_txt.Text, Email_txt.Text, isLogged_txt.Text);
                MessageBox.Show("The user was successfully added to the database!", "Adding user", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ID_txt.Clear();
                Name_txt.Clear();
                password_txt.Clear();
                Address_txt.Clear();
                Email_txt.Clear();
                permission_combo.Text = "";
            }catch (Exception exp) { exp.ToString(); }

            //}
            //else
            //    MessageBox.Show("This user already exist in database!", "Adding user", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
        }
예제 #9
0
        /// <summary>
        /// 添加信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bt_add_Click(object sender, EventArgs e)
        {
            //创建父窗体对象
            Form1 fm1 = (Form1)this.Owner;

            //判断ID是否唯一,不唯一说明已经被创建过,提示添加失败;
            for (int i = 0; i < fm1.list_studeng.Count; i++)
            {
                if (fm1.list_studeng[i].ID == ID_txt.Text)  //说明已经添加过
                {
                    MessageBox.Show("该ID已被创建,请重新输入");
                    //清除文本框内容
                    ID_txt.Clear();
                    name_txt.Clear();
                    gender_txt1.Text = null;
                    age_txt.Clear();
                    class_txt.Clear();
                    name_txt.Focus();
                    //返回
                    return;
                }
            }
            //验证信息是否正确
            if (gender_txt1.Text != "男" && gender_txt1.Text != "女")
            {
                MessageBox.Show("性别输入格式错误,请输入男或女");
                //清除文本框内容
                ID_txt.Clear();
                name_txt.Clear();
                gender_txt1.Text = null;
                age_txt.Clear();
                class_txt.Clear();
                name_txt.Focus();
                //返回
                return;
            }
            //验证年龄是否输入正确
            int age;

            try
            {
                age = Convert.ToInt32(age_txt.Text);
                if (age < 0 || age > 150)
                {
                    MessageBox.Show("年龄输入内容错误,请输入正确的年龄");
                    return;
                }
            }
            catch
            {
                MessageBox.Show("年龄输入内容错误,请输入正确的年龄");
                //清除文本框内容
                ID_txt.Clear();
                name_txt.Clear();
                gender_txt1.Text = null;
                age_txt.Clear();
                class_txt.Clear();
                name_txt.Focus();
                //返回
                return;
            }
            //信息输入正确,将信息添加至列表中
            Student stu = new Student(name_txt.Text, age, gender_txt1.Text, ID_txt.Text, class_txt.Text);

            fm1.list_studeng.Add(stu);
            MessageBox.Show("添加成功");
            ID_txt.Clear();
            name_txt.Clear();
            gender_txt1.Text = null;
            age_txt.Clear();
            class_txt.Clear();
            name_txt.Focus();
        }
예제 #10
0
 // 메인 패널 *************************************************************************************************
 private void Main_Panel_Click(object sender, EventArgs e)
 {
     Main_Panel.Visible  = false;
     Login_Panel.Visible = true;
     ID_txt.Focus();
 }
예제 #11
0
 public SearchWithID()
 {
     InitializeComponent();
     ID_txt.Focus();
 }