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, "申请失败"); } }
public FormLogin() { InitializeComponent(); //IDBox.Text = Properties.Settings.Default.loginId; //PwdBox.Text = Properties.Settings.Default.LoginPwd; IDBox.Focus(); init(); }
private void ClearFields() { IDBox.Clear(); NazwaBox.Clear(); DataBox.Clear(); IloscBox.Clear(); TypBox.SelectedIndex = -1; }
public FormLogin(string param1, string param2, AxLGUBaseOpenApi axLGUBaseOpenApi1, AxLGUBaseOpenApi axLGUBaseOpenApi2) { InitializeComponent(); init(); IDBox.Focus(); //this.param1 = param1; //this.param2 = param2; }
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(); }
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 = ""; }
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(); }
//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; } }
//아이디 입력 후 엔터 private void enterKey(object sender, KeyEventArgs e) { id = IDBox.Text.ToString(); if (e.KeyCode == Keys.Enter) { if (IDBox.Text.ToString().Equals("")) { IDBox.Focus(); MessageBox.Show("아이디를 입력해 주세요"); } else { PwdBox.Focus(); } } }
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; } } } }
private void LoginButton_Click(object sender, RoutedEventArgs e) { if (IDBox.Text == "") { MessageBox.Show("ID를 입력하세요!!"); IDBox.Focus(); return; } if (PasswordBox.Password == "") { MessageBox.Show("PWD를 입력하세요!!"); PasswordBox.Focus(); return; } MySqlConnection connect = getConn(); connect.Open(); string ConnectQurey = "SELECT * FROM info WHERE id='" + IDBox.Text + "'AND password='******'"; MySqlCommand command = new MySqlCommand(ConnectQurey, connect); MySqlDataReader read = command.ExecuteReader(); System.Console.Write("%s\n", IDBox.Text); System.Console.Write("%s\n", PasswordBox.Password); if (read.Read()) { MessageBox.Show("로그인 완료!!"); Application.Current.Properties["id"] = IDBox.Text; Window.GetWindow(this).Close(); Window3 Homepage = new Window3(); Homepage.Top = this.Top + (this.ActualHeight - Homepage.Height) / 2; Homepage.Left = this.Left + (this.ActualWidth - Homepage.Width) / 2; Homepage.ShowDialog(); } else { MessageBox.Show("로그인 실패ㅠ-ㅠ"); } }
private void loginOk1() { id = IDBox.Text.ToString(); pwd = PwdBox.Text.ToString(); if (PwdBox.Text.ToString().Equals("")) { IDBox.Focus(); MessageBox.Show("아이디를 입력해 주세요"); } else if (IDBox.Text.ToString().Equals("")) { PwdBox.Focus(); MessageBox.Show("비밀번호를 입력해 주세요"); } else { string url = "https://daemuri.net/main/getSendAuth.do?id=" + id + "&pwd=" + pwd; //string url = "http://127.0.0.1:8080/main/getSendAuth.do?id=" + id + "&pwd=" + pwd; try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "POST"; request.ContentType = "Application/json;charset=utf-8"; string sendData = ""; byte[] buffer; buffer = Encoding.Default.GetBytes(sendData); request.ContentLength = buffer.Length; Stream sendStream = request.GetRequestStream(); sendStream.Write(buffer, 0, buffer.Length); sendStream.Close(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream respPostStream = response.GetResponseStream(); StreamReader readerPost = new StreamReader(respPostStream, Encoding.UTF8); string resultJson = readerPost.ReadToEnd(); if (!resultJson.Contains("<!DOCTYPE html")) { JObject obj = new JObject(); obj = JObject.Parse(resultJson); string rs = obj["rs"].ToString(); if (rs.Equals("fail")) { MessageBox.Show("등록된 사용자가 아닙니다."); this.Height = 218; } else { JObject obj2 = new JObject(); obj2 = JObject.Parse(rs); callcenter_idx = obj2["callcenter_idx"].ToString(); //MessageBox.Show("callcenter_idx = " + callcenter_idx); CidBox.Visible = true; button3.Visible = true; CidBox.Focus(); this.Height = 335; } } else { MessageBox.Show("등록된 사용자가 아닙니다."); this.Height = 217; } } catch (System.Net.WebException er) { MessageBox.Show(er.Message); } } }
// czyszczenie pol tekstowych private void ClearLeftFields() { IDBox.Clear(); NazwiskoBox.Clear(); AdresBox.Clear(); }
private void StoreData() { // Base info SelectedQuest.StartCondition.IsEnabled = IsEnabledBox.Text == @"True"; SelectedQuest.ID = (uint)IDBox.GetValue(); SelectedQuest.Title.ID = (uint)TitleBox.GetValue(); SelectedQuest.Description.ID = (uint)DescriptionBox.GetValue(); SelectedQuest.Region = Convert.ToByte(RegionBox.GetValue()); SelectedQuest.QuestType = (QuestType)QuestTypeBox.SelectedIndex; SelectedQuest.IsRepeatAble = IsRepeatableBox.Text == @"True"; SelectedQuest.IsDailyQuest = IsDailyQuestBox.Text == @"True"; SelectedQuest.DailyType = (DailyType)DailyQuestTypeBox.SelectedIndex; // Start info SelectedQuest.StartCondition.IsInstantAccept = StartIsInstantAcceptBox.Text == @"True"; SelectedQuest.StartCondition.IsWaitListView = StartIsWaitListViewBox.Text == @"True"; SelectedQuest.StartCondition.IsWaitListProgress = StartIsWaitListProgressBox.Text == @"True"; SelectedQuest.StartCondition.NeedsLevel = StartNeedsLevelBox.Text == @"True"; SelectedQuest.StartCondition.LevelMin = (byte)StartMinLevelBox.GetValue(); SelectedQuest.StartCondition.LevelMax = (byte)StartMaxLevelBox.GetValue(); SelectedQuest.StartCondition.NeedsNPC = StartNeedsNPCBox.Text == @"True"; SelectedQuest.StartCondition.NPC.ID = (ushort)StartNPCIDBox.GetValue(); SelectedQuest.StartCondition.NeedsItem = StartNeedsItemBox.Text == @"True"; SelectedQuest.StartCondition.Item.ID = (ushort)StartItemIDBox.GetValue(); SelectedQuest.StartCondition.Item.Lot = (ushort)StartItemLotBox.GetValue(); SelectedQuest.StartCondition.NeedsLocation = StartNeedsLocationBox.Text == @"True"; SelectedQuest.StartCondition.Location = (ushort)StartLocationBox.GetValue(); SelectedQuest.StartCondition.LocationX = (uint)StartXBox.GetValue(); SelectedQuest.StartCondition.LocationY = (uint)StartYBox.GetValue(); SelectedQuest.StartCondition.LocationRange = (uint)StartRangeBox.GetValue(); SelectedQuest.StartCondition.Unk3 = (int)StartUnkBox.GetValue(); SelectedQuest.StartCondition.NeedsPreviousQuest = StartNeedsQuestBox.Text == @"True"; SelectedQuest.StartCondition.PreviousQuestID = (ushort)StartPreviousQuestBox.GetValue(); SelectedQuest.StartCondition.NeedsRace = StartNeedsRaceBox.Text == @"True"; SelectedQuest.StartCondition.Race = (Race)StartRaceBox.SelectedIndex; SelectedQuest.StartCondition.NeedsClass = StartNeedsClassBox.Text == @"True"; SelectedQuest.StartCondition.Class = (Class)StartClassBox.SelectedIndex; SelectedQuest.StartCondition.NeedsGender = StartNeedsGenderBox.Text == @"True"; SelectedQuest.StartCondition.Gender = (Gender)StartGenderBox.SelectedIndex; SelectedQuest.StartCondition.NeedsDate = StartNeedsDateBox.Text == @"True"; SelectedQuest.StartCondition.DateMode = (DateMode)StartDateModeBox.SelectedIndex; SelectedQuest.StartCondition.DateStart = (long)StartDateStartBox.GetValue(); SelectedQuest.StartCondition.DateEnd = (long)StartDateEndBox.GetValue(); // End info SelectedQuest.EndCondition.IsInstantHandIn = EndIsInstantHandInBox.Text == @"True"; SelectedQuest.EndCondition.NeedsLevel = EndNeedsLevelBox.Text == @"True"; SelectedQuest.EndCondition.Level = (byte)EndLevelBox.GetValue(); SelectedQuest.EndCondition.NeedsLocation = EndNeedsLocationBox.Text == @"True"; SelectedQuest.EndCondition.Location = (ushort)EndLocationBox.GetValue(); SelectedQuest.EndCondition.LocationX = (uint)EndXBox.GetValue(); SelectedQuest.EndCondition.LocationY = (uint)EndYBox.GetValue(); SelectedQuest.EndCondition.LocationRange = (uint)EndRangeBox.GetValue(); SelectedQuest.EndCondition.Unk7 = (int)EndUnkBox.GetValue(); SelectedQuest.EndCondition.NeedsScenario = EndNeedsScenarioBox.Text == @"True"; SelectedQuest.EndCondition.ScenarioID = (ushort)EndScenarioIDBox.GetValue(); SelectedQuest.EndCondition.NeedsRace = EndNeedsRaceBox.Text == @"True"; SelectedQuest.EndCondition.Race = (Race)EndRaceBox.SelectedIndex; SelectedQuest.EndCondition.NeedsClass = EndNeedsClassBox.Text == @"True"; SelectedQuest.EndCondition.Class = (Class)EndClassBox.SelectedIndex; SelectedQuest.EndCondition.HasTimeLimit = EndHasTimeLimitBox.Text == @"True"; SelectedQuest.EndCondition.TimeLimit = (ushort)EndTimeLimitBox.GetValue(); // Scripts SelectedQuest.StartScript = StartScriptBox.Text; SelectedQuest.StartScriptSize = (ushort)(StartScriptBox.Text.Length + 1); SelectedQuest.DoingScript = ActiveScriptBox.Text; SelectedQuest.DoingScriptSize = (ushort)(ActiveScriptBox.Text.Length + 1); SelectedQuest.EndScript = EndScriptBox.Text; SelectedQuest.EndScriptSize = (ushort)(EndScriptBox.Text.Length + 1); // Rewards StoreRewards(); }
private void IDBox_TextChanged(object sender, EventArgs e) { SelectedQuest.ID = (uint)IDBox.GetValue(); BindingSource.ResetBindings(false); }
private void button1_Click_1(object sender, EventArgs e) { if (IDBox.Text == "") { MessageBox.Show("用户名不能为空!", "提示"); } else if (PwdBox.Text == "") { MessageBox.Show("密码不能为空!", "提示"); } try //try...catch...异常处理语句 { string name, pass; bool flag = false; name = IDBox.Text; pass = PwdBox.Text; //获取用户名,密码 byte[] result = Encoding.Default.GetBytes(PwdBox.Text.Trim()); MD5 md5 = new MD5CryptoServiceProvider(); byte[] output = md5.ComputeHash(result); CheckPWD.Text = BitConverter.ToString(output).Replace("-", ""); string str = "Data Source=51WU;Initial Catalog=automobile111;User ID=sa;Password=wu777wow;"; SqlConnection myConn = new SqlConnection(str); //创建数据库连接类的对象 myConn.Open(); //将连接打开 //SQL语句:从数据库的登录表中搜索登录名,密码 string sqlstring = "select userid,userpwd from admininfo where userid='" + name + "'and userpwd='" + pass + "'"; //执行con对象的函数,返回一个SqlCommand类型的对象 SqlCommand command = new SqlCommand(sqlstring, myConn); //用cmd的函数执行语句,返回SqlDataReader对象thisReader,thisReader就是返回的结果集(也就是数据库中查询到的表数据) SqlDataReader thisReader = command.ExecuteReader(); //判断用户名及密码是否正确,对flag进行赋值 while (thisReader.Read()) { if ((thisReader.GetValue(0).ToString().Trim()) == (name.ToString().Trim())) { if (thisReader.GetValue(1).ToString().Trim() == pass.ToString().Trim()) { flag = true; } } } //用完后关闭连接,以免影响其他程序访问 myConn.Close(); if (flag) { MessageBox.Show("登录成功!"); login3 F = new login3(); //显示主页面 F.Show(); this.Hide(); } else { MessageBox.Show("请检查你的用户名和密码!"); IDBox.Focus(); } } catch (Exception ex2) { MessageBox.Show("连接远程SQL数据库发生错误:" + ex2.ToString(), "错误!"); } }
public CloudView() { InitializeComponent(); (DataContext as CloudViewModel).DownloadCompleteStream.Subscribe(_ => IDBox.Clear()); }
private void ClearFields() { IDBox.Clear(); NazwaBox.Clear(); }