private void Button_Click(object sender, RoutedEventArgs e)
        {
            int    staffId   = int.Parse(IDBox.Text);
            string staffName = NameBox.Text;
            int    staffEx   = int.Parse(ExtralBox.Text);

            while (!db.staff.Any(u => u.s_name.Trim() == staffName.Trim() && u.s_Id == staffId))
            {
                MessageBox.Show("不存在此职员!!");
                IDBox.Clear();
                NameBox.Clear();
                staffId   = int.Parse(IDBox.Text);
                staffName = NameBox.Text;
                return;
            }

            try
            {
                string        strconn = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=F:\\VsProject\\高级人事管理系统\\高级人事管理系统\\bin\\Debug\\MSDSecond.mdf;Integrated Security=True";
                SqlConnection sqlconn = new SqlConnection(strconn);
                sqlconn.Open();

                string     sql    = "insert into ApplySalary(s_Id,a_salary,s_department,s_rewAPub) values (" + staffId + "," + 0 + ",N'" + otherDepartment.cont + "'," + staffEx + ")";
                SqlCommand sqlcmd = new SqlCommand(sql, sqlconn);
                sqlcmd.ExecuteNonQuery();

                MessageBox.Show("申请成功!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "申请失败");
            }
        }
Example #2
0
 private void ClearFields()
 {
     IDBox.Clear();
     NazwaBox.Clear();
     DataBox.Clear();
     IloscBox.Clear();
     TypBox.SelectedIndex = -1;
 }
 private void Clear_Click(object sender, EventArgs e)
 {
     IDBox.Clear();
     NameBox.Clear();
     SurnameBox.Clear();
     CityBox.Clear();
     MaleRadio.Checked   = false;
     FemaleRadio.Checked = false;
 }
 private void ClearAll()
 {
     NameBox.Clear();
     IDBox.Clear();
     DeptBox.Clear();
     GRBox.Clear();
     GPAHigh.Clear();
     GPALow.Clear();
 }
Example #5
0
 private void FindCustomer_Load(object sender, EventArgs e)
 {
     NameBox.Clear();
     IDBox.Clear();
     addbutton.Enabled   = false;
     editbutton.Enabled  = false;
     orderbutton.Enabled = false;
     label2.Text         = "";
     label3.Text         = "";
 }
Example #6
0
        private void ClearDGVText(object sender, EventArgs e)
        {
            dateBox.Clear();
            cNameBox.Clear();
            IDBox.Clear();
            CPN1.Clear();
            CPN2.Clear();
            CPN3.Clear();
            phoneBrandComboBox.Text = "";
            PhoneModelComboBox.Text = "";
            imeiBox.Clear();
            for (int i = 0; i < ProblemList.Items.Count; i++)
            {
                ProblemList.SetItemChecked(i, false);
            }
            DepositBox.Text = "";
            passwordBox.Clear();
            particularsBox.Items.Clear();
            warrantyT.Checked = false;
            nopayT.Checked    = false;
            fullpayT.Checked  = false;
            depositT.Checked  = false;
            particularItem.Clear();
            itemQuantity.Clear();
            itemUnit.Clear();
            pictureBox1.Image = null;
            dateBox.Text      = DateTime.Now.ToString("yyyy/MM/dd hh:mm");
            others.Clear();
            warrantyBox.Clear();
            // ID Checking
            DataTable    dt  = new DataTable();
            string       SQL = "SELECT ID FROM InventoryTable ORDER BY ID DESC";
            OleDbCommand cmd = new OleDbCommand(SQL, con);

            try
            {
                con.Open();
                OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
                adapter.Fill(dt);
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            int newrow = 0;

            if (dt.Rows.Count > 0)
            {
                newrow = (Int32)dt.Rows[0][0];
            }
            newrow++;
            IDBox.Text = newrow.ToString();
        }
Example #7
0
        //Submit item checkout
        private void button1_Click(object sender, EventArgs e)
        {
            //determine game
            var game = gamescheck.Controls.OfType <RadioButton>().FirstOrDefault(n => n.Checked);

            //names of buttons
            var gameName = "";

            //in case no button was selected (button is null)
            try
            {
                gameName = game.Text;
            }
            catch (NullReferenceException)
            {
            }

            //controllers, hdmi, and charger controls
            var controllerNum = ControllersNum.Value;
            var hdmiNum       = 0;

            if (hdmi.Checked)
            {
                hdmiNum++;
            }
            var chargerNum = 0;

            if (chargers.Checked)
            {
                chargerNum++;
            }

            //add checkout info to list view
            listView1.Items.Add(new ListViewItem(new[] { NameBox.Text, IDBox.Text, gameName, controllerNum.ToString(), hdmiNum.ToString(), chargerNum.ToString(), Manager.MainInstance.workerName }));

            //append to csv
            System.IO.File.AppendAllText("asc_checkout_list.csv", $"{NameBox.Text}, {IDBox.Text}, {gameName}, {controllerNum.ToString()}, {hdmiNum.ToString()}, {chargerNum.ToString()}, {Manager.MainInstance.workerName}\n");

            //reset stuff
            NameBox.Clear();
            IDBox.Clear();
            ControllersNum.Value = 0;
            hdmi.Checked         = false;
            chargers.Checked     = false;

            foreach (Control ctrl in gamescheck.Controls)
            {
                (ctrl as RadioButton).Checked = false;
            }
        }
Example #8
0
        private void IDBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                String ID = IDBox.Text;
                if (ID.Substring(0, 1) == "\t")
                {
                    ID = ID.Remove(0, 1);
                }
                ISheet Pws = Hwb.GetSheetAt(0);
                for (int i = 1; i < Pws.LastRowNum; i++)
                {
                    IRow Prow = Pws.GetRow(i);
                    if (Prow.Cells[0].ToString() != "Stop" && Prow.Cells[5].ToString() == ID)
                    {
                        DataGridViewRow row = (DataGridViewRow)DGV.Rows[0].Clone();
                        row.Cells[0].Value = Prow.Cells[0].ToString();
                        row.Cells[1].Value = int.Parse(Prow.Cells[1].ToString());
                        row.Cells[2].Value = int.Parse(Prow.Cells[2].ToString());
                        row.Cells[3].Value = int.Parse(Prow.Cells[3].ToString());
                        row.Cells[4].Value = "No";
                        row.Cells[5].Value = Formatting.GetNextDate(DGV);
                        MemoryStream stream = new MemoryStream();
                        Image        pic    = Image.FromFile(@"C:\Users\email\Desktop\Hardware Hub\images\" + Prow.Cells[5] + ".png");
                        pic.Save(stream, pic.RawFormat);
                        row.Cells[6].Value = Formatting.TweetBody(Prow.Cells[0].ToString(), Prow.Cells[1].ToString(), Prow.Cells[3].ToString(), Formatting.ListToHashTags(Formatting.HashTagsFromFile(Prow.Cells[4].ToString()))).Length;
                        row.Cells[7].Value = pic;
                        row.Cells[8].Value = Prow.Cells[5].ToString();
                        row.Cells[9].Value = Formatting.ListToHashTags(Formatting.HashTagsFromFile(Prow.Cells[4].ToString()));
                        row.Height         = 100;
                        DGV.Rows.Add(row);

                        IDBox.Clear();

                        return;
                    }
                    else if (Prow.Cells[0].ToString() == "Stop")
                    {
                        MessageBox.Show("Product not found (Error in IDBOX_KeyDown() method)");
                        return;
                    }
                }
            }
        }
Example #9
0
        public CloudView()
        {
            InitializeComponent();

            (DataContext as CloudViewModel).DownloadCompleteStream.Subscribe(_ => IDBox.Clear());
        }
Example #10
0
 // czyszczenie pol tekstowych
 private void ClearLeftFields()
 {
     IDBox.Clear();
     NazwiskoBox.Clear();
     AdresBox.Clear();
 }
Example #11
0
 private void ClearFields()
 {
     IDBox.Clear();
     NazwaBox.Clear();
 }