//Set Background Data public void StartListene(Object info) { if (info == null) { return; } fMain main = (fMain)info; string response = String.Empty; int nBytes = 0; while (main.IsRunning) { try { TcpClient client = main.listener.AcceptClient; ThreadPool.QueueUserWorkItem(GetUserItem, client); } catch (Exception ex) { Console.WriteLine("Error received" + ex.Message); } } // Thread.Sleep(5000); }
private void btDangNhap_Click(object sender, EventArgs e) { try { conn.Open(); string tk = txTaiKhoan.Text; string mk = txMatKhau.Text; string sql = "Select * From DangNhap where TaiKhoan = '" + tk + "' and MatKhau = '" + mk + "' "; SqlCommand cmd = new SqlCommand(sql, conn); SqlDataReader dta = cmd.ExecuteReader(); if (dta.Read() == true) { MessageBox.Show("Đăng Nhập Thành Công"); fMain f = new fMain(); f.Show(); this.Hide(); } else { MessageBox.Show("Sai tài khoản hoặc mật khẩu"); } } catch (Exception ex) { MessageBox.Show("Lỗi Kết Nối"); } }
private void btnLogin_Click(object sender, EventArgs e) { if (txbUser.Text.Length == 0 || txbPass.Text.Length == 0) { MyMessageBox.Show("Tên đăng nhập hoặc mật khẩu bị trống!", MessageBoxButtons.OK); } else { if (BUS_LoginAccount.Login(txbUser.Text, txbPass.Text)) { if (!ckbRemember.Checked) { txbPass.Clear(); } BUS_LoginAccount.ShowAvatar(txbUser.Text); BUS_Actions.AddActions(txbUser.Text, "Đăng nhập"); fMain f = new fMain(); this.Hide(); f.ShowDialog(); this.Show(); } else { MyMessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng!", MessageBoxButtons.OK); } } }
private void button2_Click(object sender, EventArgs e) { fMain f = new fMain(); f.Show(); this.Close(); }
static void Main() { oPATH.Init(); Settings settings = new Settings() { }; if (CEF.Initialize(settings) == false) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var m = new fOther(); var f = new fMain(m); CEF.RegisterScheme("local", new SchemeHandlerFactory()); CEF.RegisterScheme("img", new ImageHandlerFactory(f)); CEF.RegisterJsObject("api", f); Application.Run(f); //Application.Run(new fEditor("ability")); m.Close(); CEF.Shutdown(); }
public fBase(Form f) { InitializeComponent(); mainForm = (fMain)f; }
private void BtnDangNhap_Click(object sender, EventArgs e) { fMain fmain = new fMain(); this.Hide(); fmain.ShowDialog(); this.Close(); }
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs) { fMain f = (fMain)this.MainForm; string[] args = new string[eventArgs.CommandLine.Count]; eventArgs.CommandLine.CopyTo(args, 0); f.ProcessCommandArgs(args); }
public ucOfficerToolkit(officeDB.OfficerRow or, atriumManager atmng, fMain mainform) { InitializeComponent(); SetAtmng(atmng, mainform); CreateNodes(); setOfficer(or); ucFileContextMenu1.LoadLabels(); LoadContextMenuLabels(); }
public ucOfficerToolkit(atriumManager atmng, fMain mainform) { InitializeComponent(); SetAtmng(atmng, mainform); CreateNodes(); if (UIHelper.getScalingFactor() > 1) { tvOfficerToolkit.ItemHeight = tvOfficerToolkit.ItemHeight + 2; } }
private static void f_main_init() { main = new fMain(); main.StartPosition = FormStartPosition.CenterScreen; main.Width = m_app_width; main.Height = m_app_height; main.Shown += main_Shown; main.FormClosing += main_Closing; Application.EnableVisualStyles(); Application.Run(main); }
public static void OpenLog(Form currentForm, bool openForm = true, string path = "") { if (openForm == true) { fMain form = new fMain(path); form.Show(); currentForm.Hide(); } StreamReader streamR = new StreamReader(path); try { while (!streamR.EndOfStream) { string line = streamR.ReadLine(); if (Regex.IsMatch(line, @"^\[Title: (.)*\]$")) { fMain.changelogTitle.Text = line.Substring(8, line.Length - 9); } else if (Regex.IsMatch(line, @"^\[Version: (.)*\]$")) { fMain.changelogVersion.Text = "Version " + line.Substring(10, line.Length - 11); } else if (Regex.IsMatch(line, @"^\[New feature: (.)*\]$")) { fMain.newFeatures.Items.Add(line.Substring(14, line.Length - 15)); } else if (Regex.IsMatch(line, @"^\[Change: (.)*\]$")) { fMain.changes.Items.Add(line.Substring(9, line.Length - 10)); } else if (Regex.IsMatch(line, @"^\[Fix: (.)*\]$")) { fMain.fixes.Items.Add(line.Substring(6, line.Length - 7)); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { streamR.Close(); AddLogToRecent(path); } }
private void login() { accountDTO.Username = txbUsername.Text; accountDTO.Password = txbPassword.Text; if (accountBus.Login(accountDTO)) { Hide(); fMain f = new fMain(accountDTO.Displayname, accountDTO.Role, accountDTO.Img); f.ShowDialog(); } else { MessageBox.Show("Sai tên tài khoản hoặc mật khẩu!!!"); txbPassword.Clear(); txbUsername.Clear(); txbUsername.Focus(); } }
public static void RUN() { //string s = api_crawler.getHtml("https://dictionary.cambridge.org/grammar/british-grammar/"); //return; dicResponses = new Dictionary <string, msg>(); dicService = new Dictionary <string, IthreadMsg>(); main = new fMain(); dicService.Add(_API.WORD_LOAD_LOCAL, new threadMsg(new api_word_LocalStore())); dicService.Add(_API.SETTING_APP, new threadMsg(new api_settingApp(), main.f_api_settingApp_responseMsg)); dicService.Add(_API.FOLDER_ANYLCTIC, new threadMsg(new api_folder_Analytic())); dicService.Add(_API.CRAWLER, new threadMsg(new api_crawler())); dicService.Add(_API.YOUTUBE, new threadMsg(new api_youtube())); dicService.Add(_API.MP3, new threadMsg(new api_mp3())); //||| MAIN main.Shown += main_Shown; main.FormClosing += main_Closing; main.onNotifyClick += (se, ev) => { if (main.isVisiable) { main.isVisiable = false; main.Hide(); } else { main.isVisiable = true; main.Show(); main.Activate(); } }; f_media_Init(); Application.Run(main); }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdJumpToFile": fMain fmain = (fMain)System.Windows.Forms.Application.OpenForms["fMain"]; fmain.OpenFile(ucRecords1.FM.CurrentFileId); break; case "cmdPreviewDoc": ucRecords1.ShowDocument = cmdPreviewDoc.IsChecked; break; case "cmdToggleSubFiles": pnlChildren.Closed = !cmdToggleSubFiles.IsChecked; AtMng.OfficeMng.GetOfficerPrefs().SetPref(OfficerPrefsBE.LawMateExplorerShowSubFiles, cmdToggleSubFiles.IsChecked); //UIHelper.SaveSetting("ShowSubFilesInLawMateExplorer", cmdToggleSubFiles.IsChecked.ToString()); LoadSubFiles = cmdToggleSubFiles.IsChecked; if (LoadSubFiles && myDM != null) { ucSubFileList1.LoadChildren(myDM.FM); } else { ucSubFileList1.Clear(); } break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
static void Main() { fMain fm = new fMain(); Application.Run(fm); }
public void SetAtmng(atriumManager atmng, fMain mainform) { Atmng = atmng; mainForm = mainform; }
private void HookupfProgress(fMain f) { fProgress = f.FProgress; }
private void label2_Click(object sender, EventArgs e) { fMain f1 = Application.OpenForms.OfType <fMain>().FirstOrDefault(); f1.SellControlAdd(5); }
public fMandateList(fMain mainForm) { InitializeComponent(); fmain = mainForm; atmng = fmain.AtMng; dtMandate = new DataTable("mandateList"); dtMandate.Columns.Add("AcSeriesId", typeof(int)); dtMandate.Columns.Add("SeriesId", typeof(int)); dtMandate.Columns.Add("Activity", typeof(string)); dtMandate.Columns.Add("Workflow", typeof(string)); dtMandate.Columns.Add("AcSeriesDeskbookLink", typeof(string)); dtMandate.Columns.Add("SeriesDeskbookLink", typeof(string)); FileManager FMforTranslation = atmng.GetFile(); FileManager cntFM = null; lmDatasets.ActivityConfig.OfficeMandateRow[] omrs = (lmDatasets.ActivityConfig.OfficeMandateRow[])atmng.acMng.DB.OfficeMandate.Select("OfficeId=" + atmng.WorkingAsOfficer.OfficeId.ToString()); foreach (lmDatasets.ActivityConfig.OfficeMandateRow omr in omrs) { try { //new form if (omr.ACSeriesRow.SeriesRow.IsContainerFileIdNull()) { cntFM = null; } else { cntFM = atmng.GetFile(omr.ACSeriesRow.SeriesRow.ContainerFileId); } if (!omr.ACSeriesRow.Obsolete && atriumBE.Workflow.AllowedForRole(omr.ACSeriesRow, atmng, cntFM)) { string ActDesc; if (!omr.ACSeriesRow.IsNull(UIHelper.Translate(FMforTranslation, "DescEng"))) { ActDesc = omr.ACSeriesRow.ActivityCodeRow[UIHelper.Translate(FMforTranslation, "ActivityNameEng")].ToString() + ": " + omr.ACSeriesRow[UIHelper.Translate(FMforTranslation, "DescEng")].ToString(); } else { ActDesc = omr.ACSeriesRow.ActivityCodeRow[UIHelper.Translate(FMforTranslation, "ActivityNameEng")].ToString(); } ActDesc = "(" + omr.ACSeriesRow.StepCode + ") " + ActDesc; string gridRowKey = "NewMandate" + omr.ACSeriesRow.StepCode; string WorkflowText = omr.ACSeriesRow.SeriesRow.SeriesCode + " - " + omr.ACSeriesRow.SeriesRow[UIHelper.Translate(FMforTranslation, "SeriesDescEng")].ToString(); ////TFS#54757 JLL 2013-8-29 modify to include help for series and acseries string AcSeriesHelpLink; string AcSeriesHelpLinkColumn = UIHelper.Translate(FMforTranslation, "HelpE"); if (!omr.ACSeriesRow.IsNull(AcSeriesHelpLinkColumn) && omr.ACSeriesRow[AcSeriesHelpLinkColumn].ToString() != "") { AcSeriesHelpLink = Properties.Resources.mHelp; } else { AcSeriesHelpLink = ""; } ////TFS#54757 JLL 2013-8-29 modify to include help for series and acseries string SeriesHelpLink; string SeriesHelpLinkColumn = UIHelper.Translate(FMforTranslation, "HelpLinkE"); if (!omr.ACSeriesRow.SeriesRow.IsNull(SeriesHelpLinkColumn) && omr.ACSeriesRow.SeriesRow[SeriesHelpLinkColumn].ToString() != "") { SeriesHelpLink = Properties.Resources.mHelp; } else { SeriesHelpLink = ""; } dtMandate.Rows.Add(omr.ACSeriesRow.ACSeriesId, omr.ACSeriesRow.SeriesId, ActDesc, WorkflowText, AcSeriesHelpLink, SeriesHelpLink); BindData(); } } catch (Exception x) { UIHelper.HandleUIException(x); } } }