Example #1
0
 private void loadRecords()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         gridData.Rows.Clear();
         IList records = RepositoryFactory.GetInstance().GetRepository(RepositoryFactory.CUSTOMER_CATEGORY_REPOSITORY).GetAll();
         foreach (CustomerCategory d in records)
         {
             int row = gridData.Rows.Add(d.CODE, d.NAME);
             gridData.Rows[row].Tag = d;
         }
         this.Cursor = Cursors.Default;
     }
     catch (Exception x)
     {
         KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #2
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            var result = KryptonMessageBox.Show("删除当前选中记录?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                ObjectView <装修明细> view = 装修明细BindingSource.Current as ObjectView <装修明细>;
                if (view != null && view.Object != null)
                {
                    context.装修明细.DeleteObject(view.Object);

                    string msg;
                    if (Helper.saveData(context, view.Object, out msg))
                    {
                        装修明细BindingSource.RemoveCurrent();//如果成功删除数据库中指定项,那么同步删除界面中当前选中项,避免再次Load数据库和刷新界面。
                    }
                    else
                    {
                        KryptonMessageBox.Show(msg, "失败");
                    }
                }
            }
        }
Example #3
0
        private void PictureBox_DoubleClick(object sender, EventArgs e)
        {
            PictureBox picBox = sender as PictureBox;
            Image      img    = picBox.Image;

            if (img != null)
            {
                //使用默认设置初始化集合的默认构造函数。默认情况下,此临时文件集合将文件存储在默认临时目录中,并在生成和使用临时文件后将其删除。
                using (TempFileCollection tfc = new TempFileCollection())
                {
                    string fileName = tfc.AddExtension("jpg", true);
                    try
                    {
                        img.Save(fileName);
                        System.Diagnostics.Process.Start(fileName);
                    }
                    catch (Exception ex)
                    {
                        KryptonMessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Example #4
0
 private void loadRecords()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         gridData.Rows.Clear();
         IList records = RepositoryFactory.GetInstance().GetRepository(RepositoryFactory.EMPLOYEE_REPOSITORY).GetAll();
         foreach (Employee d in records)
         {
             int row = gridData.Rows.Add(d.CODE, d.NAME, d.IS_SALESMAN, d.IS_STOREMAN, d.IS_PURCHASER);
             gridData.Rows[row].Tag = d;
         }
         this.Cursor = Cursors.Default;
     }
     catch (Exception x)
     {
         KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #5
0
 private void kryptonTrackBar1_Scroll(object sender, EventArgs e)
 {
     try
     {
         if (this.vlcPlayerControl.State == VlcPlayerControlState.Idle)
         {
             this.kryptonTrackBar1.Value = 0;
             return;
         }
         //
         float val = 1f * this.kryptonTrackBar1.Value / this.kryptonTrackBar1.Maximum;
         if (val != this.vlcPlayerControl.Position)
         {
             this.vlcPlayerControl.Position = val;
         }
     }
     catch (Exception exc)
     {
         //
         KryptonMessageBox.Show(String.Format("Cannot change position : {0}", exc));
     }
     isMouseClick = false;
 }
        /// <summary>
        /// Gets the palette file number.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <returns></returns>
        private int GetPaletteFileNumber(string fileName)
        {
            try
            {
                XPathNavigator xPathNavigator = (new XPathDocument(fileName)).CreateNavigator().SelectSingleNode("KryptonPalette");

                if (xPathNavigator != null)
                {
                    string attribute = xPathNavigator.GetAttribute("Version", string.Empty);

                    if (attribute != null && attribute.Length > 0)
                    {
                        return(int.Parse(attribute));
                    }
                }
            }
            catch (Exception exc)
            {
                KryptonMessageBox.Show($"Error: { exc.Message }", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(-1);
        }
        /// <summary>
        /// Downloads update and installs the update
        /// </summary>
        /// <param name="update">The update xml info</param>
        private void DownloadUpdate(SharpUpdateXML update)
        {
            SharpUpdateDownloadDialog form = new SharpUpdateDownloadDialog(update.UpdateFiles, this.applicationInfo.ApplicationIcon);
            DialogResult result            = form.ShowDialog(this.applicationInfo.Context);

            // Download update
            if (result == DialogResult.OK)
            {
                string currentPath = this.applicationInfo.ApplicationAssembly.Location;
                // "Install" it
                UpdateApplication(form.TempFilesPath, currentPath, update.LaunchArgs);

                Application.Exit();
            }
            else if (result == DialogResult.Abort)
            {
                KryptonMessageBox.Show(Language.LanguageEN.SharpUpdater_DownloadCancelled, Language.LanguageEN.SharpUpdater_DownloadCancelledTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                KryptonMessageBox.Show(Language.LanguageEN.SharpUpdater_DownloadProblem, Language.LanguageEN.SharpUpdater_DownloadProblemTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// Creates the directory.
 /// </summary>
 /// <param name="directoryPath">The directory path.</param>
 /// <param name="useVerbose">if set to <c>true</c> [use verbose].</param>
 public void CreateDirectory(string directoryPath, bool useVerbose = false)
 {
     try
     {
         if (useVerbose)
         {
             if (!DoesDirectoryExist(directoryPath))
             {
             }
         }
         else
         {
             if (!DoesDirectoryExist(directoryPath))
             {
                 Directory.CreateDirectory(directoryPath);
             }
         }
     }
     catch (Exception exc)
     {
         KryptonMessageBox.Show($"An error has occurred: { exc.Message }", "Catastrophic Directory Creation Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        /// <summary>
        /// Gets the version.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <returns></returns>
        public bool GetVersion(Assembly assembly)
        {
            if (assembly != null)
            {
                AssemblyInformation information = new AssemblyInformation();

                information.Name = assembly.GetName().Name;

                information.Version = assembly.GetName().Version.ToString();

                information.FullName = assembly.GetName().ToString();
            }
            else
            {
                ErrorMessage = "Invalid assembly specifier!";

                KryptonMessageBox.Show($"An error has occurred: { ErrorMessage }", "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return(false);
            }

            return(GetReferenceAssembly(assembly));
        }
Example #10
0
        private void EnviaEmailCCe(List <belPesquisaCCe> lsNotas)
        {
            if (Acesso.VerificaDadosEmail())
            {
                List <belEmail> objlbelEmail = new List <belEmail>();

                for (int i = 0; i < lsNotas.Count; i++)
                {
                    belEmail objemail = new belEmail("", Pastas.CCe + "\\PDF\\" + lsNotas[i].CD_NOTAFIS + ".pdf", lsNotas[i].CD_NFSEQ, lsNotas[i].CD_NOTAFIS);
                    objlbelEmail.Add(objemail);
                }

                if (objlbelEmail.Count > 0)
                {
                    frmEmail objfrmEmail = new frmEmail(objlbelEmail, belEmail.TipoEmail.CCe);
                    objfrmEmail.ShowDialog();
                }
            }
            else
            {
                KryptonMessageBox.Show(null, "Campos para o envio de e-mail automático não estão preenchidos corretamente!", Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private void btnRecaudacionMensual_Click(object sender, EventArgs e)
        {
            try
            {
                string   formated        = dtpMes.Value.Month.ToString() + '/' + dtpAn.Value.Year.ToString();
                DateTime date            = Convert.ToDateTime(formated);
                var      firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
                var      lastDayOfMonth  = firstDayOfMonth.AddMonths(1).AddDays(-1);

                string con = Properties.Settings.Default.peajeF;
                using (SqlConnection connection = new SqlConnection(con))
                {
                    using (SqlCommand cmd = new SqlCommand("sp_informe_recaudacion_mensual", connection))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@v_fecha_inicio", SqlDbType.DateTime).Value = Convert.ToDateTime(firstDayOfMonth);
                        cmd.Parameters.Add("@v_fecha_final", SqlDbType.DateTime).Value  = Convert.ToDateTime(lastDayOfMonth);
                        connection.Open();
                        cmd.ExecuteNonQuery();
                        connection.Close();
                        // TODO: esta línea de código carga datos en la tabla 'peajeDataSet.informe_recaudacion_mensual' Puede moverla o quitarla según sea necesario.
                        this.informe_recaudacion_mensualTableAdapter.Fill(this.peajeFDataSet.informe_recaudacion_mensual);
                    }
                }
                ReportParameter[] rparams = new ReportParameter[] {
                    new ReportParameter("desde", firstDayOfMonth.ToShortDateString()),
                    new ReportParameter("hasta", lastDayOfMonth.ToShortDateString()),
                };

                reportViewer3.LocalReport.SetParameters(rparams);
                this.reportViewer3.RefreshReport();
            }
            catch (Exception ex)
            {
                KryptonMessageBox.Show(ex.Message);
            }
        }
Example #12
0
        private void CancelaCte()
        {
            try
            {
                daoBuscaDadosGerais  objdaoDadosGerais = new daoBuscaDadosGerais();
                daoGravaDadosRetorno objDadosRetorno   = new daoGravaDadosRetorno();
                belCancelaCte        objCancelaCte     = new belCancelaCte();


                string        sJustificativa = txtJust.Text;
                belCancelaCte objCte         = objCancelaCte.PopulaDadosCancelamento(sCodConhecimento, sJustificativa);

                belCriaXml objXml = new belCriaXml();
                HLP.GeraXml.bel.CTe.Evento.TRetEvento ret = objXml.GerarXmlCancelamento(objCte);


                if (ret.infEvento.cStat == "135")
                {
                    objDadosRetorno.GravarReciboCancelamento(sCodConhecimento, ret.infEvento.nProt, sJustificativa);
                    objXml.SalvaArquivoPastaCancelado(objdaoDadosGerais.BuscaChaveRetornoCteSeq(objCte.chCTe));
                }

                string sMessageRetorno = string.Format("Codigo do Retorno: {0}{1}Motivo: {2}{1}Chave: {3}{1}Protocolo: {4}{1}",
                                                       ret.infEvento.cStat,
                                                       Environment.NewLine,
                                                       ret.infEvento.xMotivo,
                                                       ret.infEvento.chCTe,
                                                       ret.infEvento.nProt);

                KryptonMessageBox.Show(sMessageRetorno, Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #13
0
        //完成检验按钮
        private void ktbn_end_Click(object sender, EventArgs e)
        {
            DialogResult result = KryptonMessageBox.Show("确定提交检验结果吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == System.Windows.Forms.DialogResult.No)
            {
                return;
            }
            string dt = Tools.ServiceReferenceManager.GetClient().RunServerAPI("BLL.OQC", "GetNGList", oqcno + "," + orderno);
            List <P_OQC_NGList> oqcList = JsonConvert.DeserializeObject <List <P_OQC_NGList> >(dt);
            int NGNum = 0;

            if (oqcList == null)//没有不良
            {
                NGNum = 0;
            }
            else
            {
                foreach (var item in oqcList)
                {
                    int num = Convert.ToInt32(item.ng_qty);
                    NGNum += num;
                }
            }
            if (NGNum >= Convert.ToInt32(maxNGValue)) //记录的不良数大于检验标准不良拒收值
            {
                string oqcResult = "1";               //1代表检验结果为NG
                ResultToOQCOrder(oqcno, orderno, oqcResult);
                MessageBox.Show("本批次检验结果为NG", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                string oqcResult = "0";//0代表检验结果为OK
                ResultToOQCOrder(oqcno, orderno, oqcResult);
                MessageBox.Show("本批次检验结果为OK", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
Example #14
0
        private void openToolStripButton_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "XML files|*.xml;";
                if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    try
                    {
                        XmlDocument xmlDoc = new XmlDocument();
                        xmlDoc.Load(ofd.FileName);

                        XmlNodeList options    = xmlDoc.GetElementsByTagName("O");
                        XmlNode     option     = options[0];
                        Boolean     isVertical = Convert.ToBoolean(option.Attributes["vertical"].InnerText);
                        Boolean     isRandom   = Convert.ToBoolean(option.Attributes["randomEdges"].InnerText);

                        XmlNodeList Vertexes = xmlDoc.GetElementsByTagName("V");
                        XmlNodeList Edges    = xmlDoc.GetElementsByTagName("E");

                        EditorForm ef = new EditorForm(isVertical, isRandom);

                        foreach (XmlNode v in Vertexes)
                        {
                            ef.graph.AddVertex(new PointF(Convert.ToSingle(v.Attributes["X"].InnerText), Convert.ToSingle(v.Attributes["Y"].InnerText)));
                        }
                        foreach (XmlNode ed in Edges)
                        {
                            ef.graph.AddEdge(ef.graph.VertexCollection[Convert.ToInt32(ed.Attributes["S"].InnerText)], ef.graph.VertexCollection[Convert.ToInt32(ed.Attributes["T"].InnerText)], Convert.ToInt32(ed.Attributes["W"].InnerText));
                        }
                        ef.MdiParent = this;
                        ef.Show();
                    }
                    catch (Exception) { KryptonMessageBox.Show("Couldnt open file", "", MessageBoxButtons.OK, MessageBoxIcon.Error); }
                }
            }
        }
Example #15
0
        private void kryptonButtonInput_Click(object sender, EventArgs e)
        {
            if (DialogResult.No == KryptonMessageBox.Show(
                    "本操作将会覆盖目录下已存在的文件,要开始神一般的杀戮吗?",
                    "哦死你开挂?",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question,
                    MessageBoxDefaultButton.Button2))
            {
                return;
            }

            int count = 0;

            try
            {
                foreach (var file in Directory.GetFiles(kryptonTextBox2.Text, "*.sav"))
                {
                    count++;

                    var textData = new TextData();

                    var stfp = new SavedTranslationFormatProvider(file);

                    textData.LoadTranslation(Path.Combine(kryptonTextBox1.Text, Path.GetFileName(stfp.ScriptPath)),
                                             stfp.Lines);

                    textData.BuildScript(Path.Combine(kryptonTextBox3.Text, Path.GetFileName(stfp.ScriptPath)));
                }
            }
            catch (Exception ea)
            {
                KryptonMessageBox.Show(ea.Message);
            }

            KryptonMessageBox.Show(string.Format("已导入 {0} 个文件。", count));
        }
Example #16
0
        /// <summary>
        /// Gets the reference assembly.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <returns></returns>
        public bool GetReferenceAssembly(Assembly assembly)
        {
            try
            {
                AssemblyName[] assemblyNameList = assembly.GetReferencedAssemblies();

                if (assemblyNameList.Length > 0)
                {
                    AssemblyInformation information = null;

                    ReferenceAssembly = new List <AssemblyInformation>();

                    for (int i = 0; i < assemblyNameList.Length; i++)
                    {
                        information = new AssemblyInformation();

                        information.Name = assemblyNameList[i].Name;

                        information.Version = assemblyNameList[i].Version.ToString();

                        information.FullName = assemblyNameList[i].ToString();

                        ReferenceAssembly.Add(information);
                    }
                }
            }
            catch (Exception error)
            {
                ErrorMessage = error.Message;

                KryptonMessageBox.Show($"An error has occurred: { ErrorMessage }", "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return(false);
            }

            return(true);
        }
Example #17
0
        /// <summary>
        /// 发送
        /// </summary>
        private void Send(List <long> RoomsId, string ErrMsgName, int SendType, ExtendInfo info, Action success = null)
        {
            StartLoad(this, null);

            Task.Factory.StartNew(() =>
            {
                try
                {
                    bool result = OperatesService.GetOperates().ServiceSend(RoomsId, SendType, JsonConvert.SerializeObject(info));

                    // 如果成功则提示
                    if (result)
                    {
                        this.BeginInvoke(new Action(() =>
                        {
                            KryptonMessageBox.Show(this, string.Format(Resources.GetRes().GetString("OperateSuccess"), ErrMsgName), Resources.GetRes().GetString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);

                            if (null != success)
                            {
                                success();
                            }
                        }));
                    }
                }
                catch (Exception ex)
                {
                    this.BeginInvoke(new Action(() =>
                    {
                        ExceptionPro.ExpLog(ex, new Action <string>((message) =>
                        {
                            KryptonMessageBox.Show(this, message, Resources.GetRes().GetString("Warn"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }), false, string.Format(Resources.GetRes().GetString("OperateFaild"), ErrMsgName));
                    }));
                }
                StopLoad(this, null);
            });
        }
        /// <summary>
        /// Gets the file version information.
        /// </summary>
        /// <param name="filePath">The file path.</param>
        /// <returns></returns>
        private Version GetFileVersionInformation(string filePath)
        {
            Version tmpVersion;

            try
            {
                if (File.Exists(filePath))
                {
                    tmpVersion = Version.Parse(FileVersionInfo.GetVersionInfo(filePath).FileVersion);

                    return(tmpVersion);
                }
            }
            catch (Exception error)
            {
                KryptonMessageBox.Show($"An error has occurred: { error.Message }", "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                tmpVersion = Version.Parse("0.0.0.0");
            }

            tmpVersion = Assembly.GetExecutingAssembly().GetName().Version;

            return(tmpVersion);
        }
Example #19
0
 public void Save(object sender, EventArgs e)
 {
     try
     {
         if (Valid())
         {
             this.Cursor = Cursors.WaitCursor;
             UpdateEntity();
             if (m_warehouse.ID == 0)
             {
                 RepositoryFactory.GetInstance().GetRepository(RepositoryFactory.WAREHOUSE_REPOSITORY).Save(m_warehouse);
                 Warehouse bank = (Warehouse)RepositoryFactory.GetInstance().GetRepository(RepositoryFactory.WAREHOUSE_REPOSITORY).GetByCode(m_warehouse);
                 int       r    = gridData.Rows.Add(bank.CODE, bank.NAME);
                 gridData.Rows[r].Tag = bank;
             }
             else
             {
                 RepositoryFactory.GetInstance().GetRepository(RepositoryFactory.WAREHOUSE_REPOSITORY).Update(m_warehouse);
                 updateRecord();
             }
             KryptonMessageBox.Show("Record has been saved", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
             gridData.ClearSelection();
             ClearForm();
             textBoxCode.Focus();
             this.Cursor = Cursors.Default;
         }
     }
     catch (Exception x)
     {
         KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #20
0
        private void btnStackTrace_Click(object sender, EventArgs e)
        {
            try
            {
                void InfiniteLoopIt(int howDeep)
                {
                    if (howDeep > 50)
                    {
                        throw new InsufficientExecutionStackException();
                    }

                    InfiniteLoopIt(++howDeep);
                }

                InfiniteLoopIt(1);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.StackTrace, ex.Message);
                KryptonMessageBox.Show(this, ex.StackTrace, ex.Message);
                KryptonTaskDialog.Show(ex.Message, "MinInstruction", ex.StackTrace, MessageBoxIcon.Stop,
                                       TaskDialogButtons.Close);
            }
        }
Example #21
0
        private void CheckForUpdates(string updateXMLPath)
        {
            try
            {
                if (utilities.CheckInternetConnectionState())
                {
                    if (utilities.ExistsOnServer(new Uri(updateXMLPath)))
                    {
                        XMLParser.ParseUpdateXMLFile(updateXMLPath);

                        if (utilities.IsNewerThan(Version.Parse(updatePackageInformation.GetCurrentInstalledVersion())))
                        {
                            kbtnCheckForUpdates.Visible = false;

                            klblCurrentStatus.Text = "A new update is now available!";
                        }
                    }
                }
            }
            catch (Exception exc)
            {
                KryptonMessageBox.Show($"Error: { exc.Message }", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnInformeSemanal_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime fecha_inicial = dtpPrimeraSemana.Value.Date;
                DateTime fecha_final   = dtpUltimaSemana.Value.Date;
                string   fecha_i       = fecha_inicial.ToString("dd/MM/yyyy");
                string   fecha_f       = fecha_final.ToString("dd/MM/yyyy");
                string   con           = Properties.Settings.Default.SC;
                using (SqlConnection connection = new SqlConnection(con))
                {
                    using (SqlCommand cmd = new SqlCommand("sp_informe_recaudacion_semanal", connection))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@v_fecha_inicio", SqlDbType.DateTime).Value = Convert.ToDateTime(fecha_i);
                        cmd.Parameters.Add("@v_fecha_final", SqlDbType.DateTime).Value  = Convert.ToDateTime(fecha_f);
                        connection.Open();
                        cmd.ExecuteNonQuery();
                        connection.Close();
                        // TODO: esta línea de código carga datos en la tabla 'peajeMDataSet.informe_recaudacion_semanal' Puede moverla o quitarla según sea necesario.
                        this.informe_recaudacion_semanalTableAdapter.Fill(this.peajeMDataSet.informe_recaudacion_semanal);
                    }
                }
                ReportParameter[] rparams = new ReportParameter[] {
                    new ReportParameter("desde", fecha_i),
                    new ReportParameter("hasta", fecha_f),
                };

                reportViewer3.LocalReport.SetParameters(rparams);
                this.reportViewer3.RefreshReport();
            }
            catch (Exception ex)
            {
                KryptonMessageBox.Show(ex.Message);
            }
        }
Example #23
0
        private bool ValidateControls()
        {
            bool result = true;

            validateControl.Clear();
            validateControl.BlinkRate = 250;
            if (!GlobalApplicationSettings.IsDbExists)
            {
                KryptonMessageBox.Show("Nie znaleziono pliku kofiguracyjnego do bazy danych. Proszę skofigurować base SQL!", "Uwaga", MessageBoxButtons.OK, MessageBoxIcon.Information);
                result = false;
            }
            if (!Txt_Login.Text.HasValue())
            {
                validateControl.SetError(Txt_Login, "!");
                result = false;
            }
            if (!Txt_Password.Text.HasValue())
            {
                validateControl.SetError(Txt_Password, "!");
                result = false;
            }

            return(result);
        }
Example #24
0
        private void btnDetalleSemanal_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime fecha_inicial = dtpPrimeraSemana.Value.Date;
                DateTime fecha_final   = dtpUltimaSemana.Value.Date;
                string   fecha_i       = fecha_inicial.ToString("dd/MM/yyyy");
                string   fecha_f       = fecha_final.ToString("dd/MM/yyyy");
                string   con           = Properties.Settings.Default.SI;
                using (SqlConnection connection = new SqlConnection(con))
                {
                    using (SqlCommand cmd = new SqlCommand("sp_informe_total_vehiculos_rango", connection))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@fecha_inicio", SqlDbType.DateTime).Value = Convert.ToDateTime(fecha_i);
                        cmd.Parameters.Add("@fecha_fin", SqlDbType.DateTime).Value    = Convert.ToDateTime(fecha_f);
                        connection.Open();
                        cmd.ExecuteNonQuery();
                        connection.Close();

                        this.sp_informe_total_vehiculos_rangoTableAdapter.Fill(this.CajaSantaIsabelDataSet.sp_informe_total_vehiculos_rango, Convert.ToDateTime(fecha_i), Convert.ToDateTime(fecha_f));
                    }
                }

                ReportParameter[] rparams = new ReportParameter[] {
                    new ReportParameter("desde", fecha_i),
                    new ReportParameter("hasta", fecha_f),
                };
                reportViewer2.LocalReport.SetParameters(rparams);
                this.reportViewer2.RefreshReport();
            }
            catch (Exception ex)
            {
                KryptonMessageBox.Show(ex.Message);
            }
        }
        private void kryptonButton1_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime fecha_elegida = kryptonDateTimePicker2.Value.Date;
                string   fecha         = fecha_elegida.ToString("dd-MM-yyyy");
                string   con           = Properties.Settings.Default.peajeF;
                using (SqlConnection connection = new SqlConnection(con))
                {
                    using (SqlCommand cmd = new SqlCommand("sp_informe_cobrados_nocobrados", connection))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@fecha", SqlDbType.DateTime).Value = Convert.ToDateTime(fecha);
                        connection.Open();
                        cmd.ExecuteNonQuery();
                        connection.Close();
                    }
                }
                this.informe_tickets_cobradosTableAdapter.Fill(this.peajeFDataSet.informe_tickets_cobrados);

                this.sp_informe_total_vehiculosTableAdapter.Fill(this.peajeFDataSet.sp_informe_total_vehiculos, Convert.ToDateTime(fecha));

                this.sp_informe_promedio_permanenciaTableAdapter.Fill(this.peajeFDataSet.sp_informe_promedio_permanencia, Convert.ToDateTime(fecha));


                ReportParameter[] rparams = new ReportParameter[] {
                    new ReportParameter("fecha", fecha)
                };
                reportViewer8.LocalReport.SetParameters(rparams);
                this.reportViewer8.RefreshReport();
            }
            catch (Exception ex)
            {
                KryptonMessageBox.Show(ex.Message);
            }
        }
Example #26
0
        private void kryptonButton5_Click(object sender, EventArgs e)
        {
            //Component.Tool.DisplayResult(textBox4, true, "");
            //Component.Tool.DisplayResult(textBox3, true, "");
            string       SFC    = ktb_input1.Text.Trim();
            DialogResult result = KryptonMessageBox.Show("确定拆包吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == System.Windows.Forms.DialogResult.No)
            {
                return;
            }
            try
            {
                string             tra = Tools.ServiceReferenceManager.GetClient().RunServerAPI("BLL.Pack", "GetTrayDetail", SFC);
                List <P_SFC_State> mn  = JsonConvert.DeserializeObject <List <P_SFC_State> >(tra);

                foreach (var item in mn)
                {
                    string sfc      = item.SFC;
                    string tray_sfc = SFC;
                    Tools.ServiceReferenceManager.GetClient().RunServerAPI("BLL.Pack", "DelSFC", sfc + "," + tray_sfc);
                }
                List <P_SFC_State> kn = new List <P_SFC_State>();
                Component.Tool.DisplayResult(textBox1, true, "拆包成功,输入下一个托盘号");
                kryptonDataGridView1.DataSource = kn;
                ktb_input1.Text = "";
                ktb_input2.Text = "";
                ktb_input1.Focus();
                ktb_input2.Enabled = false;
            }
            catch (Exception)
            {
                MessageBox.Show("拆包失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                throw;
            }
        }
Example #27
0
        /// <summary>
        /// 构造函数
        /// </summary>
        internal LibraryLinker()
        {
            int    type = Properties.Settings.Default.LibraryType;
            string path = Properties.Settings.Default.LibraryPath;

            //检查库是否存在
            if ((!File.Exists(path)) && (type != 0))
            {
                KryptonMessageBox.Show("指定的解析库不存在,使用纯文本模式。");
                type = 0;
            }

            try
            {
                //初始化初始化库
                switch (type)
                {
                case 1:     //DynamicCodeWrapper
                    library = new DynamicCodeWrapper(path, Encoding.UTF8);
                    break;

                case 2:     //NetWrapper
                    library = new NetWrapper(path);
                    break;

                default:
                    library = new PureTextWrapper();
                    break;
                }
            }
            catch (Exception e)
            {
                KryptonMessageBox.Show(e.Message);
                Environment.Exit(0);
            }
        }
Example #28
0
 private void updatekryptonButton1_Click(object sender, EventArgs e)
 {
     if (KryptonMessageBox.Show("Are you sure to update?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         try
         {
             this.Cursor = Cursors.WaitCursor;
             if (m_result.Count > 0)
             {
                 r_part.UpdateSellingPrice(m_result);
                 KryptonMessageBox.Show("Update completed.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             this.Cursor = Cursors.Default;
         }
         catch (Exception x)
         {
             KryptonMessageBox.Show(x.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         finally
         {
             this.Cursor = Cursors.Default;
         }
     }
 }
Example #29
0
        private void btnSair_Click_1(object sender, EventArgs e)
        {
            if (!txtCaminho.Text.Equals(""))
            {
                // belRegedit.SalvarRegistro(Pastas.CONFIG.ToString(), Pastas.Caminho_xmls.ToString(), txtCaminho.Text);

                Pastas.PASTA_XML_CONFIG = txtCaminho.Text;

                this.Close();
            }
            else
            {
                if (KryptonMessageBox.Show(null, "Nenhum Caminho válido foi Selecionado, o Sistema será finalizado!"
                                           + Environment.NewLine
                                           + Environment.NewLine
                                           + "Deseja selecionar uma outra Pasta?",
                                           Mensagens.CHeader,
                                           MessageBoxButtons.YesNo,
                                           MessageBoxIcon.Question) == DialogResult.No)
                {
                    this.Close();
                }
            }
        }
Example #30
0
        private void btnDetalleMensual_Click(object sender, EventArgs e)
        {
            try
            {
                string   formated        = kryptonDateTimePicker3.Value.Month.ToString() + '/' + kryptonDateTimePicker4.Value.Year.ToString();
                DateTime date            = Convert.ToDateTime(formated);
                var      firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
                var      lastDayOfMonth  = firstDayOfMonth.AddMonths(1).AddDays(-1);
                string   con             = Properties.Settings.Default.SI;
                using (SqlConnection connection = new SqlConnection(con))
                {
                    using (SqlCommand cmd = new SqlCommand("sp_informe_total_vehiculos_rango", connection))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@fecha_inicio", SqlDbType.DateTime).Value = Convert.ToDateTime(firstDayOfMonth);
                        cmd.Parameters.Add("@fecha_fin", SqlDbType.DateTime).Value    = Convert.ToDateTime(lastDayOfMonth);
                        connection.Open();
                        cmd.ExecuteNonQuery();
                        connection.Close();

                        this.sp_informe_total_vehiculos_rangoTableAdapter.Fill(this.CajaSantaIsabelDataSet.sp_informe_total_vehiculos_rango, Convert.ToDateTime(firstDayOfMonth), Convert.ToDateTime(lastDayOfMonth));
                    }
                }

                ReportParameter[] rparams = new ReportParameter[] {
                    new ReportParameter("desde", firstDayOfMonth.ToShortDateString()),
                    new ReportParameter("hasta", lastDayOfMonth.ToShortDateString()),
                };
                reportViewer3.LocalReport.SetParameters(rparams);
                this.reportViewer3.RefreshReport();
            }
            catch (Exception ex)
            {
                KryptonMessageBox.Show(ex.Message);
            }
        }