Exemplo n.º 1
0
        private void MycmdExecute_Click()
        {
            try
            {
                ItemsSource.Clear();
                using (SqlExcuteCommand get = new SqlExcuteCommand()
                {
                    DBCnnStr = DBEndososCnnStr
                })
                {
                    //if (cbPartido_Item_Id > 1)
                    //    return;

                    String mpartido = isPartidos == true ? cbPartido[cbPartido_Item_Id].PartidoKey : String.Empty;   // cbPartido_Item.Split('-');

                    _MyLotsVoidTable = get.MyGetLotVoid(mpartido.ToString().Trim(), dpFchRecibo.ToString("MM/dd/yyyy"), isDuplicados, isFechaRecibo, isPartidos);
                    txtTotal         = string.Format("{0:N0}", _MyLotsVoidTable.Rows.Count);

                    foreach (DataRow r in _MyLotsVoidTable.Rows)
                    {
                        infoEndososRechazados myLotsVoid = new infoEndososRechazados();
                        myLotsVoid.Partido      = r["Partido"].ToString().Trim();
                        myLotsVoid.Lot          = r["Lot"].ToString().Trim();
                        myLotsVoid.Batch        = r["Batch"].ToString().Trim();
                        myLotsVoid.Formulario   = Convert.ToInt32(r["Formulario"].ToString().Trim());
                        myLotsVoid.Rechazo      = r["Rechazo"].ToString().Trim();
                        myLotsVoid.Causal       = r["Causal"].ToString().Trim();
                        myLotsVoid.NumElec      = r["NumElec"].ToString().Trim();
                        myLotsVoid.Status       = r["Status"].ToString().Trim();
                        myLotsVoid.Nombre       = r["Nombre"].ToString().Trim();
                        myLotsVoid.Paterno      = r["Paterno"].ToString().Trim();
                        myLotsVoid.Materno      = r["Materno"].ToString().Trim();
                        myLotsVoid.EndosoImage  = (Byte[])r["EndosoImage"];
                        myLotsVoid.Firma_Fecha  = r["Firma_Fecha"].ToString().Trim();
                        myLotsVoid.Fecha_Endoso = r["Fecha_Endoso"].ToString().Trim();
                        myLotsVoid.Fecha_Recibo = r["Fecha_Recibo"].ToString().Trim();
                        ItemsSource.Add(myLotsVoid);
                    }
                }
                MessageBox.Show("Done...\r\nTotal:" + string.Format("{0:N0}", _MyLotsVoidTable.Rows.Count), "Done", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
            catch (Exception ex)
            {
                MethodBase site = ex.TargetSite;
                MessageBox.Show(ex.Message, site.Name, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Exemplo n.º 2
0
        private void MyDoubleClickCommand()
        {
            try
            {
                if (System.DBNull.Value.Equals(dgSelectedIndex))
                {
                    return;
                }

                if (dgSelectedIndex < 1)
                {
                    return;
                }

                infoEndososRechazados drv = dgSelectedItem;


                if (!System.DBNull.Value.Equals(drv.EndosoImage))
                {
                    Byte[] tif = (Byte[])drv.EndosoImage;

                    String numelec = Guid.NewGuid().ToString(); // drv.NumElec.Trim();

                    if (!System.IO.Directory.Exists("c:\\SFTEMP\\"))
                    {
                        Directory.CreateDirectory("c:\\SFTEMP\\");
                    }

                    String tiffName = "c:\\SFTEMP\\" + numelec + ".tif";

                    _filesTmp.Add(tiffName);

                    File.WriteAllBytes(tiffName, tif);
                    System.Diagnostics.Process process = new System.Diagnostics.Process();

                    process.StartInfo.FileName = tiffName;
                    process.Start();
                }
            }
            catch (Exception ex)
            {
                MethodBase site = ex.TargetSite;
                MessageBox.Show(ex.Message, site.Name, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }