public Export(object sender, object model) { MF = (Main_Form)sender; Model = (CModel)model; InitializeComponent(); foreach (CModel.DProperty prop in Model.Props) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(dataGridView1); row.Cells[0].Value = prop.Name; row.Cells[1].Value = prop.Name + "_out.txt"; dataGridView1.Rows.Add(row); } }
private void login_Button_Click(object sender, EventArgs e) { using (_context = new HairSpaContext()) { if (ActiveUser.AreCredentialsValid(_context, username_TextBox.Text, password_TextBox.Text)) { var main_Form = new Main_Form(); main_Form.LogoutClicked += new EventHandler(main_Form_LogoutClicked); main_Form.Show(); username_TextBox.Text = ""; password_TextBox.Text = ""; this.Hide(); } } }
public ACF_Form(Main_Form parent_form, List <double> norm_data, int min_period, int max_period) { InitializeComponent(); this.parent_form = parent_form; this.norm_data = norm_data; val_max_period.Minimum = min_period; val_min_period.Minimum = min_period; val_max_period.Maximum = this.norm_data.Count - 1 + 9; val_min_period.Maximum = this.norm_data.Count - 1 + 9; val_min_period.Value = min_period; txt_min_period.Text = val_min_period.Value.ToString(); val_max_period.Value = max_period; txt_max_period.Text = val_max_period.Value.ToString(); chart_ACF.ChartAreas[0].AxisX.IsStartedFromZero = false; this.Show(); acf(); }
private static void Return_Values_From_Heavensward() { Main_Form.Notify("Storing info from Heavensward into Main"); Main_Form.Insight_month.Semana1.Save_Heavensward_Info(insight_Month_Local.Semana1); Main_Form.Insight_month.Semana2.Save_Heavensward_Info(insight_Month_Local.Semana2); Main_Form.Insight_month.Semana3.Save_Heavensward_Info(insight_Month_Local.Semana3); Main_Form.Insight_month.Semana4.Save_Heavensward_Info(insight_Month_Local.Semana4); if (Main_Form.week_five_exist) { Main_Form.Insight_month.Semana5.Save_Heavensward_Info(insight_Month_Local.Semana5); } }
//******************************************************* // Information checker plus information transfering such // as user position, username and password for further // modification if the user intend to modify its own // password. // Username = UserID and that can only be modified by // an authorized MIS Manager. //******************************************************* private void btnLogin_Click(object sender, EventArgs e) { if (Validator.Validation.IsNumber(txtUserName) && Validator.Validation.IsPresent(txtPass) && Validator.Validation.IsPresent(txtUserName)) { int abcd = Convert.ToInt32(txtUserName.Text); int indexEmp = GeneralDataManipulation.listOfEmployee.FindIndex(r => r.EmpId.Equals(abcd)); if ((indexEmp == -1) || (!GeneralDataManipulation.listOfEmployee[indexEmp].UseSystem)) { attempt++; MetroMessageBox.Show(this, "Verify the username/password. Attempt " + attempt + " of 3.", "Invalid data", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (attempt == 3) { MetroMessageBox.Show(this, "Invalid username/password entered multiple times. The application will shut down", "Invalid attempt to login", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Close(); } } else if ((GeneralDataManipulation.listOfEmployee[indexEmp].UserPassword == txtPass.Text)) { Form MainForm = new Main_Form(); GeneralDataManipulation.userPosition = GeneralDataManipulation.listOfEmployee[indexEmp].EmpPosition; GeneralDataManipulation.userID = GeneralDataManipulation.listOfEmployee[indexEmp].EmpId; GeneralDataManipulation.userPass = GeneralDataManipulation.listOfEmployee[indexEmp].UserPassword; GeneralDataManipulation.userINDEX = indexEmp; this.Hide(); MainForm.ShowDialog(); this.Close(); } else { attempt++; MetroMessageBox.Show(this, "Verify the username/password. Attempt " + attempt + " of 3.", "Invalid data", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (attempt == 3) { MetroMessageBox.Show(this, "Invalid username/password entered multiple times. The application will shut down", "Invalid attempt to login", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Close(); } } } else { MetroMessageBox.Show(this, "Verify your entries!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public void TestMethod4() { Main_Form frm1 = new Main_Form(); EventArgs e = new EventArgs(); frm1.textBox_point_X.Text = "22"; frm1.textBox_point_Y.Text = "39"; frm1.textBox_tr_AX.Text = "22"; frm1.textBox_tr_AY.Text = "45"; frm1.textBox_tr_BX.Text = "33"; frm1.textBox_tr_BY.Text = "23"; frm1.textBox_tr_CX.Text = "45"; frm1.textBox_tr_CY.Text = "36"; frm1.button_CheckPoint_Click(this, e); frm1.button_Clear_Click(this, e); Assert.AreEqual("Не пройдена", frm1.label_check_status.Text); }
public void Login() { try { if (txtusernamelogin.Text != "" && txtpasswordlogin.Text != "") { string query = "SELECT * FROM db_nursing_scheduler_system.tbl_user WHERE user_username ='******' AND user_password = '******';"; adapt = new MySqlDataAdapter(query, db.OpenConnection()); table.Clear(); adapt.Fill(table); if (table.Rows.Count > 0) { foreach (DataRow dr in table.Rows) { position = dr[4].ToString(); this.Visible = false; } } else { lblnotifllogin.Text = "NO ACCOUNT FOUND!."; } switch (position) { case "user": Main_Form mf = new Main_Form(); mf.Show(); break; case "admin": MessageBox.Show("admin"); break; } } else if (txtusernamelogin.Text == "" || txtpasswordlogin.Text == "") { lblnotifllogin.Text = "PLEASE FILL ALL REQUIREMENTS!."; } else { lblnotifllogin.Text = "NO ACCOUNT FOUND!."; } lblnotifllogin.Location = new Point(res.autocenterobjects_X(lblnotifllogin.Width, pnllogin.Width), this.lblnotifllogin.Bounds.Y); lblnotifllogin.Visible = true; } catch { MessageBox.Show("this"); } }
public Add_Books(Main_Form MyGrid) { InitializeComponent(); this.Grid = MyGrid; StreamReader sw = new StreamReader("Add.txt"); string line = ""; do { line = sw.ReadLine(); if (line != null) { string[] str = line.Split(';'); comitems.Items.Add(str[0]); } } while (line != null); sw.Close(); }
private void check_expire_date() { bool exists_key = check_reg(); if (!exists_key) { //first use, so we need to write expire date bool is_write = write_reg(); if (!is_write) { MessageBox.Show("Run program as administrator and try again."); this.Close(); } } var dt = read_reg_val(); if (dt != null) { DateTime current_date = DateTime.UtcNow; DateTime reg_date = DateTime.UtcNow; DateTime.TryParse(dt, out reg_date); var res = (current_date - reg_date).TotalDays; if (res < 7) { Main_Form frm = new Main_Form(); this.Hide(); frm.Show(); } else { MessageBox.Show("Please connect to internet for extend time !"); //do any other work..... } } else { MessageBox.Show("Error, try again !"); this.Close(); } }
private static void Initial_Heavensward_Check() { try { /*ToDo * Change Initialization * Get Random ID * Write in Firebase * Give 5 tries to read and compare that value * */ using (var client = new WebClient()) using (client.OpenRead("http://clients3.google.com/generate_204")) { Main_Form.Notify("Initial Check: Internet Connection: Granted!"); } } catch { Main_Form.Warn("Initial Check: Internet Connection: Denied!"); } }
private void timer1_Tick(object sender, EventArgs e) { if (truee && waiting < timetoopen + 1) { if (waiting == timetoopen) { mainform = new Main_Form(); mainform.frm_login = this; var nv = (new BLL_NhanVien()).GetObjectFromID(_Login.ReadNV()); var user = (new BLL_User()).GetObjectFromMaNV(nv.MaNV.Trim()); string ten = user == null?nv.TenNV.Trim() : user.TenUser.Trim(); mainform.Text = mainform.Text + " (" + ten + " - " + ((new BLL_User()).IsUser(nv.MaNV.Trim()) ? "User)" : "Admin)"); mainform._NhanVienLogining = nv; mainform.Show(); waiting++; } else { waiting++; } } }
public ChoicePicture_Form(DirectoryInfo dir, Main_Form form, Touch touch, int selectbutton) { this.dir = dir; //工程路径 this.fMain_Form = form; //主窗体的指针 this.fTouch_Form = touch; IsImageTrasparent = false; selectButton = selectbutton; InitializeComponent(); Check_Backgroundcolor.CheckedChanged += Check_Backgroundcolor_CheckedChanged; if (Main_Form.LanguageType == "English") { confirm.Text = "Confirm"; cancel.Text = "Cancel"; Check_Backgroundcolor.Text = "Remove background color"; } else { confirm.Text = "确认"; cancel.Text = "取消"; Check_Backgroundcolor.Text = "去掉背景色"; } }
private void loginButtom_Click(object sender, EventArgs e) { User User = new User(); List <User> Users = User.Sql_Select(); int Number_User = Users.Count; bool Cheak = false; string User_Name = ""; for (int i = 0; i < Number_User; i++) { if (Users[i].Get_User() == userNameTextBox.Text && Users[i].Get_Password() == passwordTextBox.Text) { Cheak = true; User_Name = Users[i].Get_First_Name() + " " + Users[i].Get_Last_Name(); break; } else { MessageBox.Show("اسم المستخدم او كلمة المرور غير صحيحة حاول مرة اخرى", "خطا في الدخول", MessageBoxButtons.OK, MessageBoxIcon.Error); passwordTextBox.Text = "Enter Password"; passwordTextBox.ForeColor = Color.Silver; userNameTextBox.Text = "Enter User Name"; userNameTextBox.ForeColor = Color.Silver; break; } } if (Cheak == true) { Main_Form Main = new Main_Form(ref User_Name); Main.Show(); } }
public static void Overwatch_Thread_Handler() { while (true) { if (OW_Request && !Attending_OW_Request && Objects_Created) { OW_Request = false; Attending_OW_Request = true; Overwatch_Control(); } if (!Initial_Check) { Initial_Check = true; Main_Form.Notify("Initial Check: Overwatch reporting"); } if (!Objects_Created && Main_Form.UI_running) { Create_Overwatch_Objs(); Objects_Created = true; } Thread.Sleep(2000); } }
private void Add_Qty_Load(object sender, EventArgs e) { GetData(); getUnit(); Main_Form.GetInstance().Enabled = false; }
private void Add_Qty_FormClosing(object sender, FormClosingEventArgs e) { Main_Form.GetInstance().Enabled = true; }
private void Add_DVMR_Item_Load(object sender, EventArgs e) { Main_Form.GetInstance().Enabled = false; searchUser(); }
public ChangePasswordWindow(int type, Main_Form main_Form) { this.type = type; this.form = main_Form; InitializeComponent(); }
public Main_FormController() { Main_Form = new Main_Form(); }
string StrSave_Path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);///先设置默认的路径为桌面 public Engineering_attribute_Form(Main_Form mainform) { this.mainform = mainform;///这里的用法类似于指针 InitializeComponent(); LoadText(); }
private void Add_Lvl1_Module_Load(object sender, EventArgs e) { Main_Form.GetInstance().Enabled = false; getModule(); }
private void saveBtn_Click(object sender, EventArgs e) { if (textBox1.Text.Trim() == "") { MessageBox.Show("Please fill up 'Module Name'.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); textBox1.Focus(); } else { if (comboBox4.Text == "") { MessageBox.Show("Please select 'Module Status'.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); comboBox4.Focus(); } else { if (saveBtn.Text == "Save") { DialogResult dialog = MessageBox.Show("Are you sure you want to save Module (Level 1)?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { string xstatdesc = comboBox4.Text; int xstatid = 1; var statid = (from c in obj.WMS_TYPE_STAT where c.stat_desc == xstatdesc select c.stat_id).FirstOrDefault(); xstatid = statid; var dateQuery = obj.Database.SqlQuery <DateTime>("SELECT getdate()"); DateTime serverDate = dateQuery.AsEnumerable().First(); var xmodule = obj.Set <WMS_MSTR_MODULE>(); xmodule.Add(new WMS_MSTR_MODULE { mod_name = textBox1.Text.Trim(), mod_datecrtd = serverDate, stat_id = xstatid, mod_crtdby = loggedin_user.userId }); obj.SaveChanges(); MessageBox.Show("Successfully saved Module.", "", MessageBoxButtons.OK, MessageBoxIcon.Information); clearFieldslvl1(); panelvl1.Height = 0; ModuleList(); Main_Form.GetInstance().AddItemsToModule(); } else if (dialog == DialogResult.No) { } } else { DialogResult dialog = MessageBox.Show("Are you sure you want to update Module (Level 1)?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { string xstatdesc = comboBox4.Text; int xstatid = 1; var statid = (from c in obj.WMS_TYPE_STAT where c.stat_desc == xstatdesc select c.stat_id).FirstOrDefault(); xstatid = statid; var dateQuery = obj.Database.SqlQuery <DateTime>("SELECT getdate()"); DateTime serverDate = dateQuery.AsEnumerable().First(); int xmodid = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value); obj.WMS_MSTR_MODULE.Where(c => c.mod_id == xmodid).ToList().ForEach(x => { x.mod_name = textBox1.Text.ToString().Replace("'", "''"); x.mod_dateuptd = serverDate; x.mod_uptdby = loggedin_user.userId; x.stat_id = xstatid; }); obj.SaveChanges(); MessageBox.Show("Successfully updated Module.", "", MessageBoxButtons.OK, MessageBoxIcon.Information); clearFieldslvl1(); panelvl1.Height = 0; ModuleList(); Main_Form.GetInstance().AddItemsToModule(); } else if (dialog == DialogResult.No) { } } } } }
public Add_Student(Main_Form gf) { InitializeComponent(); this.Grid = gf; }
/// <summary> /// 登录处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonLogin_Click(object sender, EventArgs e) { try { //是否初次登陆 string ifinitLogin = ConfigurationSettings.AppSettings["ifinitLogin"].ToString(); if (ifinitLogin.Equals("1") || (UserInfo.logInMode != null && UserInfo.logInMode.Equals("1"))) { string yljgInit = comFz.Text; if (txtCzy.Text.Equals("admin")) { DataTable dt = new DataTable(); dt.Columns.Add("userId"); dt.Columns.Add("jkda_czy"); dt.Columns.Add("gzz"); dt.Columns.Add("yljg"); dt.Rows.Add(); dt.Rows[0]["userId"] = "admin"; dt.Rows[0]["jkda_czy"] = "admin"; dt.Rows[0]["yljg"] = yljgInit; dt.Rows[0]["gzz"] = "admin"; this.Tag = dt; //登录信息 UserInfo.Yybm = yljgInit; UserInfo.Username = "******"; UserInfo.userId = "admin"; UserInfo.gzz = ""; Main_Form formJktj = new Main_Form(); formJktj.Owner = this; this.Hide(); formJktj.Show(); return; } else { MessageBox.Show("登录信息不正确,请确认"); return; } } DBAccess dBAccess = new DBAccess(); //个人信息 string sql = "SELECT Xt_gg_czy.bm, Xt_gg_czy.pym, Xt_gg_czy.xm, Xt_gg_czy.yybh FROM Xt_gg_czy where bm='{bm}' and yybh='{yybm}' and (kl='{kl}' or kl is null )"; DataTable dtResult = dBAccess.ExecuteQueryBySql(sql.Replace("{bm}", txtCzy.Text).Replace("{yybm}", comFz.SelectedValue.ToString()).Replace("{kl}", txtMm.Text)); if (dtResult != null && dtResult.Rows.Count > 0) { //工作组 string sqlGzz = "SELECT YLJGBM, GZZBM, CZY, JKDA_CZY FROM T_JK_GZZ_CZY where CZY='{CZY}' and YLJGBM='{YLJGBM}' "; DataTable dtGzz = dBAccess.ExecuteQueryBySql(sqlGzz.Replace("{CZY}", txtCzy.Text).Replace("{YLJGBM}", comFz.SelectedValue.ToString())); DataTable dt = new DataTable(); if (dtGzz != null && dtGzz.Rows.Count > 0) { //DataTable dt = new DataTable(); dt.Columns.Add("userId"); dt.Columns.Add("jkda_czy"); dt.Columns.Add("gzz"); dt.Columns.Add("yljg"); dt.Rows.Add(); dt.Rows[0]["userId"] = txtCzy.Text; dt.Rows[0]["jkda_czy"] = dtGzz.Rows[0]["JKDA_CZY"].ToString(); dt.Rows[0]["yljg"] = comFz.SelectedValue.ToString(); dt.Rows[0]["gzz"] = dtGzz.Rows[0]["GZZBM"].ToString(); //登录信息 UserInfo.Yybm = comFz.SelectedValue.ToString(); UserInfo.Yymc = comFz.Text.ToString(); UserInfo.Username = dtResult.Rows[0]["xm"].ToString(); UserInfo.userId = txtCzy.Text; UserInfo.gzz = dtGzz.Rows[0]["GZZBM"].ToString(); } else { //用户没有分配工作组 dt.Columns.Add("userId"); dt.Columns.Add("jkda_czy"); dt.Columns.Add("gzz"); dt.Columns.Add("yljg"); dt.Rows.Add(); dt.Rows[0]["userId"] = txtCzy.Text; dt.Rows[0]["jkda_czy"] = ""; dt.Rows[0]["yljg"] = comFz.SelectedValue.ToString(); dt.Rows[0]["gzz"] = ""; //登录信息 UserInfo.Yybm = comFz.SelectedValue.ToString(); UserInfo.Yymc = comFz.Text.ToString(); UserInfo.Username = dtResult.Rows[0]["xm"].ToString(); UserInfo.userId = txtCzy.Text; UserInfo.gzz = ""; MessageBox.Show("该用户没有分配工作组!"); } this.Tag = dt; Main_Form formJktj = new Main_Form(); formJktj.Owner = this; this.Hide(); formJktj.Show(); ////测试lis //jktj formJktj = new jktj(); //formJktj.Owner = this; //this.Hide(); //formJktj.Show(); //formJktj.Focus(); } else { MessageBox.Show("登录信息不正确,请确认"); txtCzy.Focus(); } } catch (Exception ex) { MessageBox.Show("登录信息不正确,请确认!" + ex.Message); } }
public static void Init(Control playerWindow) { main_form = new Main_Form(); main_form.Initialize(playerWindow); }
public Add_Cat(Main_Form MyGrid) { InitializeComponent(); this.Grid = MyGrid; }
private void Dvmr_Uploading_Data_Load(object sender, EventArgs e) { Main_Form.GetInstance().Enabled = false; }
private void button1_Click(object sender, EventArgs e) { Main_Form m = new Main_Form(); m.Show(); }
public Second(Main_Form mainForm) { _mainForm = mainForm; }
private void Dvmr_Uploading_Data_FormClosing(object sender, FormClosingEventArgs e) { Main_Form.GetInstance().Enabled = true; }
public Login_Form(int type, Main_Form form) { this.type = type; this.form = form; InitializeComponent(); }