/// <summary> /// 无参数并且无返回值 /// </summary> /// <param name="method"></param> public void NonParmAndNonReturnMethod(DelegateNonParmAndNonReturn method) { nonParmAndNonReturn = method; formloading = new FrmLoading(); formloading.backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorkerLoad_NonParmAndNonReturn); SetDisplayText(Desc); formloading.ShowDialog(); formloading.Close(); }
private void FrmFilterSuratKeluar_Load(object sender, EventArgs e) { InitControl(); Thread t = new Thread(Init); t.IsBackground = true; t.Start(); frmLoading = new FrmLoading(); frmLoading.ShowDialog(); }
private void Button1_Click(object sender, EventArgs e) { f = new FrmLoading(); f.Show(); AliPay pay = new AliPay(); pay.TradeCallBack += PayFinish; pay.TradeFinish += CloseForm; Task t = Task.Factory.StartNew(() => { pay.Handle(); }); }
/// <summary> /// 有参数并且无返回值 /// </summary> /// <param name="method"></param> /// <param name="para"></param> public void HasParmAndNonReturnMethod(DelegateHasParmAndNonReturn method, object para = null) { parmLoading = para; hasParmAndNonReturn = method; formloading = new FrmLoading(); formloading.backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorkerLoad_HasParmAndNonReturn); SetDisplayText(Desc); formloading.ShowDialog(); formloading.Close(); }
private void FrmFilterSuratKeluar_Load(object sender, EventArgs e) { InitControl(); Thread t = new Thread(Init); t.IsBackground = true; t.Start(); frmLoading = new FrmLoading(); frmLoading.ShowDialog(); }
private void BindingDataGrid() { gvHistoryLoginUser.Rows.Clear(); Thread bindingDataSurat; bindingDataSurat = new Thread(GenerateDataHistory); bindingDataSurat.IsBackground = true; bindingDataSurat.Start(); frmLoading = new FrmLoading(); frmLoading.ShowDialog(); }
public static async Task Loading(this Form form, Action action) { form.Hide(); using (FrmLoading fm = new FrmLoading()) { fm.Show(form); await Task.Run(action); fm.Close(); } form.Show(); }
/// <summary> /// 开始加载 /// </summary> /// <param name="message">消息</param> /// <param name="ownerForm">父窗体</param> /// <param name="work">待执行工作</param> /// <param name="workArg">工作参数</param> public static void ShowLoading(string message, Form ownerForm, ParameterizedThreadStart work, object workArg = null) { var loadingForm = new FrmLoading(message); dynamic expandoObject = new ExpandoObject(); expandoObject.Form = loadingForm; expandoObject.WorkArg = workArg; loadingForm.SetWorkAction(work, expandoObject); loadingForm.ShowDialog(ownerForm); if (loadingForm.WorkException != null) { throw loadingForm.WorkException; } }
public static H3D Merge(string[] FileNames, Renderer Renderer, H3D Scene = null) { if (Scene == null) { //Renderer.DeleteAll(); Scene = new H3D(); } int OpenFiles = 0; using (FrmLoading Form = new FrmLoading(FileNames.Length)) foreach (string FileName in FileNames) { Form.Proceed(FileName); H3DDict <H3DBone> Skeleton = null; if (Scene.Models.Count > 0) { Skeleton = Scene.Models[0].Skeleton; } H3D Data = FormatIdentifier.IdentifyAndOpen(FileName, Skeleton); if (Data != null) { Scene.Merge(Data); Renderer.Merge(Data); OpenFiles++; } } if (OpenFiles == 0) { MessageBox.Show( "Unsupported file format!", "Can't open file!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } return(Scene); }
private void BtnInserir_Click(object sender, EventArgs e) { this.operacao = "inserir"; this.DisponibilizarBotoesTela(EnumControleTelas.SalvarCancelarExcluir); txtValorAdicional.Enabled = true; txtPercentualDesconto.Enabled = true; txtClienteId.Text = Convert.ToString(1); txtClienteVeiculoId.Text = Convert.ToString(1); txtClienteSelecionado.Text = Convert.ToString("SEM CLIENTE"); txtValorTotalMaodeObra.Text = Convert.ToDecimal("0").ToString("C"); txtValorTotalPecas.Text = Convert.ToDecimal("0").ToString("C"); txtValorMaoDeObraManual.Text = Convert.ToDecimal("0").ToString("C"); txtValorPecaManual.Text = Convert.ToDecimal("0").ToString("C"); txtValorAdicional.Text = Convert.ToDecimal("0").ToString("C"); txtPercentualDesconto.Text = Convert.ToDecimal("0").ToString("P"); txtValorDesconto.Text = Convert.ToDecimal("0").ToString("C"); txtValorTotal.Text = Convert.ToDecimal("0").ToString("C"); txtDescricao.Text = "PESQUISANDO"; Servico servico = new Servico { ClienteVeiculoId = Convert.ToInt32(txtClienteVeiculoId.Text), Descricao = txtDescricao.Text, Status = (int)EnumStatusOrcamento.IniciadoPendente, DataCadastro = DateTime.Now, DataAlteracao = null, Ativo = true, ServicoMaodeObra = new List <ServicoMaodeObra>(), ServicoPeca = new List <ServicoPeca>() }; FrmLoading loading = new FrmLoading(); loading.Show(); var servicoId = _servicoApplication.SalvarServico(servico); txtServicoId.Text = servicoId.ToString(); }
public async void MensagemEMAIL(string AgendaManutencaoEMAIL) { FrmLoading loading = new FrmLoading(); try { if ((!string.IsNullOrEmpty(ParametrosDados.EMAIL)) && (!string.IsNullOrEmpty(ParametrosDados.SENHA))) { //enviar email using (System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient()) { smtp.Host = ParametrosDados.smtp.ToString().Trim(); smtp.Port = Convert.ToInt32(ParametrosDados.Porta.ToString().Trim()); smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential(ParametrosDados.EMAIL.ToString().Trim(), ParametrosDados.SENHA.ToString().Trim()); using (System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage()) { mail.From = new System.Net.Mail.MailAddress(ParametrosDados.EMAIL.ToString().Trim()); //if (!string.IsNullOrWhiteSpace(textBoxPara.Text)) //para o email //{ string NomeCliente = Convert.ToString(DGVDADOS.SelectedRows[0].Cells["NOME"].Value); string Email = Convert.ToString(DGVDADOS.SelectedRows[0].Cells["EMAIL"].Value); mail.To.Add(new System.Net.Mail.MailAddress(Email.ToString().Trim())); //"*****@*****.**")); //} //else //{ //MessageBox.Show("Campo 'para' é obrigatório.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; //} //if (!string.IsNullOrWhiteSpace(textBoxCC.Text)) //mail.CC.Add(new System.Net.Mail.MailAddress(textBoxCC.Text)); //if (!string.IsNullOrWhiteSpace(textBoxCCo.Text)) //mail.Bcc.Add(new System.Net.Mail.MailAddress(textBoxCCo.Text)); //desmenbrando a data DateTime data = Convert.ToDateTime(DGVDADOS.SelectedRows[0].Cells["DATA_AGENDAMENTO"].Value); CultureInfo culture = new CultureInfo("pt-BR"); DateTimeFormatInfo dtfi = culture.DateTimeFormat; int dia = data.Day; int ano = data.Year; string mes = culture.TextInfo.ToTitleCase(dtfi.GetMonthName(data.Month)); string diasemana = culture.TextInfo.ToTitleCase(dtfi.GetDayName(data.DayOfWeek)); string dataDesmenbrada = dia + " / " + mes + " / " + ano; var contentID = "Image"; var inlineLogo = new Attachment(Application.StartupPath + "/Pegasus.jpg"); inlineLogo.ContentId = contentID; inlineLogo.ContentDisposition.Inline = true; inlineLogo.ContentDisposition.DispositionType = DispositionTypeNames.Inline; mail.Attachments.Add(inlineLogo); mail.Subject = "Confirmação de agendamento";// asunto mail.Body += "<h1>Agendamento</h1><br />" + "Ola(" + NomeCliente + " )<br />" + " " + AgendaManutencaoEMAIL + " prevista para o (Mês de " + mes + ") . Data ( " + dataDesmenbrada + "), está aberto." + " Aguardamos sua confirmação." + " Atenciosamente," + " Setor Administrativo"; mail.IsBodyHtml = true; //foreach (string file in listBoxAttachments.Items) //{ // mail.Attachments.Add(new System.Net.Mail.Attachment(file)); //} loading.Show(); await smtp.SendMailAsync(mail); loading.Close(); MessageBoxEx.Show("E-mail Enviando com Sucesso. "); } } } } catch (Exception ex) { loading.Close(); MessageBoxEx.Show("Erro: " + ex.Message + ex.StackTrace); } }
private void BindingDataGrid() { gvHistoryLoginUser.Rows.Clear(); Thread bindingDataSurat; bindingDataSurat = new Thread(GenerateDataHistory); bindingDataSurat.IsBackground = true; bindingDataSurat.Start(); frmLoading = new FrmLoading(); frmLoading.ShowDialog(); }
public void showloading() { frmLoading = new FrmLoading(); frmLoading.Show(); }
private void btAcessar_Click(object sender, EventArgs e) { Usuarios user = new Usuarios(); DataTable dt = new DataTable(); //Usando o SALT na senha string senha = getMD5(textSenha.Text + "1Sport8Fitne55%"); try { dt = user.select(" where nome = '" + textUsuario.Text + "' and senha = '" + senha + "'"); if (dt.Rows.Count == 1) { //Cria os arquivos TXT StreamWriter us = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "\\user.txt", false); StreamWriter sw = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "\\tempAcademia.txt", false); // Verifica se encontrou o usuário (login/senha) if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\tempAcademia.txt")) { try { File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "\\tempAcademia.txt", string.Empty); File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "\\user.txt", string.Empty); } catch { } } Usuarios usuarios = new Usuarios(); //Procura o Usuário no Banco de Dados ArrayList array = usuarios.selectArray(" where nome = '" + textUsuario.Text + "' and senha = '" + senha + "'"); foreach (Usuarios usuario in array) { //Grava o id do usuário no arquivo TXT us.WriteLine(usuario.Id); us.Close(); //Fecha o arquivo texto } sw.WriteLine(getMD5(reverse(textUsuario.Text))); sw.WriteLine(textUsuario.Text); //Usando o SALT na senha sw.WriteLine(getMD5(textSenha.Text + "1Sport8Fitne55%")); sw.WriteLine(getMD5(reverse(textSenha.Text + "1Sport8Fitne55%"))); sw.Close(); //Fecha o arquivo texto #region Gravar o log Logs logs = new Logs(); string linha; using (StreamReader reader = new StreamReader("user.txt")) { linha = reader.ReadLine(); } logs.IdUsuario = Convert.ToInt16(linha.ToString()); logs.IdAcao = 1; logs.Data = DateTime.Today.ToString("dd/MM/yyyy"); logs.Hora = DateTime.Now.ToString("HH:mm"); logs.insert(); #endregion FrmLoading loading = new FrmLoading(); loading.Show(); // Ok, indica usuário válido this.DialogResult = DialogResult.OK; this.Dispose(); } else { //Exibe a mensagem de erro MessageBox.Show("Erro... Usuário ou senha inválidos.", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); textUsuario.Clear(); textUsuario.Focus(); textSenha.Clear(); } } catch { //Exibe a mensagem de erro MessageBox.Show("Erro ao conectar no banco de dados!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); Close(); } }
private async void criarPagamentoToolStripMenuItem_Click(object sender, EventArgs e) { FrmLoading loading = new FrmLoading(); try { if ((!string.IsNullOrEmpty(ParametrosDados.EMAIL)) && (!string.IsNullOrEmpty(ParametrosDados.SENHA))) { //enviar email using (System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient()) { smtp.Host = ParametrosDados.smtp.ToString().Trim(); smtp.Port = Convert.ToInt32(ParametrosDados.Porta.ToString().Trim()); smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential(ParametrosDados.EMAIL.ToString(), ParametrosDados.SENHA.ToString().Trim()); using (System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage()) { mail.From = new System.Net.Mail.MailAddress(ParametrosDados.EMAIL.ToString().Trim()); //if (!string.IsNullOrWhiteSpace(textBoxPara.Text)) //para o email //{ string NomeCliente = Convert.ToString(DGVDADOS.SelectedRows[0].Cells["NOME"].Value); var ClienteTela = new CLIENTEDAL().CONSULTATODOSPELONOME(NomeCliente); if (ClienteTela.EMAILPARTICULAR == null) { MessageBoxEx.Show("Cliente não tem E-mail cadastrado!"); return; } mail.To.Add(new System.Net.Mail.MailAddress(ClienteTela.EMAILPARTICULAR.ToString().Trim())); //"*****@*****.**")); //} //else //{ //MessageBox.Show("Campo 'para' é obrigatório.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; //} //if (!string.IsNullOrWhiteSpace(textBoxCC.Text)) //mail.CC.Add(new System.Net.Mail.MailAddress(textBoxCC.Text)); //if (!string.IsNullOrWhiteSpace(textBoxCCo.Text)) //mail.Bcc.Add(new System.Net.Mail.MailAddress(textBoxCCo.Text)); //desmenbrando a data DateTime data = Convert.ToDateTime(DGVDADOS.SelectedRows[0].Cells["DATA_VENCIMENTO"].Value); CultureInfo culture = new CultureInfo("pt-BR"); DateTimeFormatInfo dtfi = culture.DateTimeFormat; int dia = data.Day; int ano = data.Year; string mes = culture.TextInfo.ToTitleCase(dtfi.GetMonthName(data.Month)); string diasemana = culture.TextInfo.ToTitleCase(dtfi.GetDayName(data.DayOfWeek)); string dataDesmenbrada = dia + " / " + mes + " / " + ano; var contentID = "Image"; var inlineLogo = new Attachment(Application.StartupPath + "/Pegasus.jpg"); inlineLogo.ContentId = contentID; inlineLogo.ContentDisposition.Inline = true; inlineLogo.ContentDisposition.DispositionType = DispositionTypeNames.Inline; mail.Attachments.Add(inlineLogo); mail.Subject = "Cobrança de Mensalidade";// asunto mail.Body += "<h1>CARTA DE COBRANÇA</h1><br />" + "Ola,( " + DGVDADOS.SelectedRows[0].Cells["NOME"].Value + " )<br /> " + "Consta em nossos cadastros que o pagamento referente (ao serviço de rastreamento veicular), (Mês de " + mes + ") . Com vencimento na data ( " + dataDesmenbrada + "), ainda está em aberto.<br /> " + "Valor da mensalidade R$: " + DGVDADOS.SelectedRows[0].Cells["VALOR"].Value + ".<br /> <br /><br />" + "Caso tenha alguma dúvida ou oposição ao processo e também haja interesse em realizar a quitação do valor, <br /> " + " peço que entre em contato por um dos números ficaremos felizes em atendê-lo. <br /> <br /> " + "Atenciosamente,<br /> " + "Setor Administrativo";// texto mail.IsBodyHtml = true; //foreach (string file in listBoxAttachments.Items) //{ // mail.Attachments.Add(new System.Net.Mail.Attachment(file)); //} loading.Show(); await smtp.SendMailAsync(mail); loading.Close(); MessageBoxEx.Show("E-mail Enviando com Sucesso. "); } } } } catch (Exception ex) { loading.Close(); MessageBoxEx.Show("Erro: " + ex.Message + ex.StackTrace); } }