private void button3_Click(object sender, EventArgs e) { if (txtPw.Text == "") { errorProvider1.SetError(txtPw, "Password cannot be a null value."); commonFunctions.SetMDIStatusMessage("Password cannot be a null value.", 1); return; } if (txtPw.Text != txtRePw.Text) { errorProvider1.SetError(txtPw, "Password and the confirmation password must be same"); commonFunctions.SetMDIStatusMessage("Password and the confirmation password must be same.", 1); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { u_Userxcc obju_User = new u_Userxcc(); obju_User.userId = commonFunctions.Loginuser; obju_User = new U_UserxDL().Selectu_User(obju_User); obju_User.password = commonFunctions.CreateCheckPassword(true, txtPw.Text.Trim()); new U_UserxDL().Saveu_UserSP(obju_User, 3); pnl_pass.Visible = false; } }
private void shutdown_ToolBar_Click(object sender, EventArgs e) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_exit, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { Wantexit = true; Application.Exit(); } }
private void toolStripButton1_Click(object sender, EventArgs e) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_logoff, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { this.Hide(); CheckIfFormIsOpen("frmU_Login").Visible = true; } }
static void Main() { //try //{ if (mutex.WaitOne(TimeSpan.Zero, true)) { if (!commonFunctions.ValidateMachineDateTimeFromat()) { return; } u_DBConnection.getConnection(); Globals.PopulateSysSetup(); commonFunctions.LoadDefault(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new frm_reportViwer()); string filePath = ConfigurationManager.AppSettings["LogFilePath"].ToString(); if (Directory.Exists(filePath)) { //MessageBox.Show(Application.CommonAppDataPath.Trim()); //MessageBox.Show(Application.ExecutablePath.Trim()); //MessageBox.Show(filePath); Application.Run(new frmU_Login()); //Application.Run(new SmartAnything.UI.frm_seccenter()); } else { UserDefineMessages.ShowMsg("Log File Path " + filePath.Trim() + " not found. Application will configure a deferant path. Please Rerun the application.", UserDefineMessages.Msg_Information); Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath); config.AppSettings.Settings.Remove("LogFilePath"); config.AppSettings.Settings.Add("LogFilePath", Application.LocalUserAppDataPath.Trim()); config.Save(ConfigurationSaveMode.Modified); Application.Exit(); return; } //} //catch (System.Data.SqlClient.SqlException exsql) { // UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Error_Loginfail, commonFunctions.Softwarename.Trim()); //} //catch (Exception ex) //{ // UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_Error_common, commonFunctions.Softwarename.Trim()); //} mutex.ReleaseMutex(); } else { UserDefineMessages.ShowMsg("One instance of the" + "Software" + " is already running. Please look at the notification area", UserDefineMessages.Msg_Information); } }
private void performButtons(xEnums.PerformanceType xenum) { switch (xenum) { case xEnums.PerformanceType.View: if (ActiveControl.Name.Trim() == txt_bankcode.Name.Trim()) { int length = Convert.ToInt32(ConfigurationManager.AppSettings["BankFieldLength"]); string[] strSearchField = new string[length]; string strSQL = ConfigurationManager.AppSettings["BankSQL"].ToString(); for (int i = 0; i < length; i++) { string m; m = i.ToString(); strSearchField[i] = ConfigurationManager.AppSettings["BankField" + m + ""].ToString(); } frmU_Search find = new frmU_Search(strSQL, strSearchField, this); find.ShowDialog(this); } break; case xEnums.PerformanceType.New: FunctionButtonStatus(xEnums.PerformanceType.New); formMode = 1; txt_bankcode.Focus(); break; case xEnums.PerformanceType.Edit: FunctionButtonStatus(xEnums.PerformanceType.Edit); formMode = 2; txt_name.Focus(); break; case xEnums.PerformanceType.Save: if (txt_bankcode.Text.Trim() == "") { errorProvider1.SetError(txt_bankcode, "Please enter a bank Code !"); return; } if (txt_name.Text.Trim() == "") { errorProvider1.SetError(txt_name, "Please enter a bank name !"); return; } if (formMode == 1) { if (M_BankDL.ExistingBank(txt_bankcode.Text.Trim())) { UserDefineMessages.ShowMsg("The bank code you have entered already exists!", UserDefineMessages.Msg_Warning); return; } if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Bank objbank = new M_Bank(); objbank.BANK_CODE = txt_bankcode.Text.Trim(); objbank.BANK_NAME = txt_name.Text.Trim().ToUpper(); M_BankDL bal = new M_BankDL(); bal.SaveBankSP(objbank, 1); GetData(); FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Save_Sucess_string, 2); } } else if (formMode == 2) { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Update, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { M_Bank objbank = new M_Bank(); objbank.BANK_CODE = txt_bankcode.Text.Trim(); objbank.BANK_NAME = txt_name.Text.Trim().ToUpper(); M_BankDL bal = new M_BankDL(); bal.SaveBankSP(objbank, 3); GetData(); FunctionButtonStatus(xEnums.PerformanceType.Save); commonFunctions.SetMDIStatusMessage(UserDefineMessages.Msg_Update_Sucess_string, 2); } } break; case xEnums.PerformanceType.Cancel: FunctionButtonStatus(xEnums.PerformanceType.Default); break; case xEnums.PerformanceType.Print: string reporttitle = "List of All Banks".ToUpper(); frm_reportViwer rpt = new frm_reportViwer(); rpt.MdiParent = MDI_SMartAnything.ActiveForm; rpt.FormHeadertext = reporttitle; ParameterField paramField = new ParameterField(); ParameterFields paramFields = new ParameterFields(); paramFields = commonFunctions.AddCrystalParams(reporttitle, commonFunctions.Loginuser); rpt_banks rptBank = new rpt_banks(); M_BankDL bankdlx = new M_BankDL(); rptBank.SetDataSource(bankdlx.SelectAllBanks()); rpt.RepViewer.ParameterFieldInfo = paramFields; rpt.RepViewer.ReportSource = rptBank; rpt.RepViewer.Refresh(); rpt.Show(); break; } }