private void btn_Login_Click(object sender, EventArgs e) { string loginName = txt_loginName.Text.Trim(); string loginPassword = txt_loginPassword.Text.Trim(); if (!string.IsNullOrEmpty(loginName) && !string.IsNullOrEmpty(loginPassword)) { UserLogin userLogin = new UserLogin(); bool result = userLogin.IsExist(new User(loginName, loginPassword)); if (result) { OperateIniFile.GetInstance().WriteIniData("LoginLocal", "UserName", loginName); OperateIniFile.GetInstance().WriteIniData("LoginLocal", "PassWord", loginPassword); User user = userLogin.GetUser(loginName, loginPassword); UserHelper.SetUser(user); UserHelper.SetLogin(true); Hide(); Frm_FirstPage frm = GetFormHelper.GetFirstPage(this, true); frm.Show(); frm.Activate(); } else { XtraMessageBox.Show("用户名或密码错误。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { XtraMessageBox.Show("用户名和密码不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Dgv_DataShow_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { string columnName = dgv_DataShow.Columns[e.ColumnIndex].Name; if ("control".Equals(columnName)) { if (MessageBox.Show("本批次完结,请线下发送确认函和文件清单。", "温馨提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK) { object trpId = dgv_DataShow.Rows[e.RowIndex].Cells["id"].Value; SqlHelper.ExecuteNonQuery($"UPDATE transfer_registration_pc SET trp_complete_status='{(int)SubmitStatus.Completed}', trp_complete_user='******' WHERE trp_id='{trpId}'"); LoadDataGridView(string.Empty); } } else if ("file".Equals(columnName)) { object value = dgv_DataShow.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; object trpId = dgv_DataShow.Rows[e.RowIndex].Cells["id"].Value; if ("齐备".Equals(value)) { Frm_Print frm = GetFormHelper.GetPrintDoc(this, 1, trpId); frm.Show(); frm.Activate(); } else { Frm_Print frm = GetFormHelper.GetPrintDoc(this, 2, trpId); frm.Show(); frm.Activate(); } } } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevExpress.XtraEditors.Controls.Localizer.Active = new Tools.LocalizationCHS(); BonusSkins.Register(); SkinManager.EnableFormSkins(); UserLookAndFeel.Default.SetSkinStyle("DevExpress Style"); Application.Run(GetFormHelper.GetLoginForm()); //Application.Run(new Frm_SpecialSymbol()); }
private void ExportEFile_Click(object sender, EventArgs e) { int count = dgv_DataShow.SelectedRows.Count; if (count == 1) { SplashScreenManager.ShowDefaultWaitForm(this, false, false); object trpId = dgv_DataShow.SelectedRows[0].Cells["id"].Value; Frm_ExportEFile exportEFile = GetFormHelper.GetExportEFile(trpId); exportEFile.Show(); exportEFile.Activate(); SplashScreenManager.CloseDefaultSplashScreen(); } else { DevExpress.XtraEditors.XtraMessageBox.Show("请选择一个批次进行导出。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }