AsistenteOffBase.cs
1 //using sage.ew.db;
3 using sage.ew.global;
5 using System;
6 using System.Collections.Generic;
7 using System.ComponentModel;
8 using System.Data;
9 using System.Linq;
10 using System.Text;
11 using System.Windows.Forms;
12 
13 namespace sage.addons.offline.Negocio.Clases
14 {
18  internal class AsistenteOffBase : Interficies.IAsistenteOffBase
19  {
20  #region eventos
21 
25  protected internal delegate void _Mostrar_Progreso(String message);
26 
32  protected internal delegate void _Porcen_Progreso(decimal porcen, string message);
33 
37  protected internal event _Mostrar_Progreso _Mostrar_Progreso_Async;
38 
42  protected internal event _Porcen_Progreso _Porcen_Progreso_Async;
43 
44  #endregion eventos
45 
46  #region Variables Privadas
47 
48  private bool TerminalSeguridad = false;
49  private int TipoOffline = 1;
50  private int TipoComunicacion = 2; // 1 -> comunicación via SKYDRIVE/OneDrive, 2 -> comunicación via FTP, per defecto FTP
51 
52  private clsOffLine toolsOffline = new clsOffLine();
53 
54  private DataRow sucursal;
55  protected IAsistenteOfflineDA _asistenteOfflineDA;
56  #endregion Variables Privadas
57 
58 
59  #region Propiedades
60 
61 
62  public FtpUserData ftp_user_data = new FtpUserData();
63  public BindingList<Sucursales> _Sucursales = new BindingList<Sucursales>();
64 
68  public int IdConf { get; set; } = 0;
69 
70  public string IdLog { get; set; } = string.Empty;
71 
75  public int EnvioImagenes { get; set; } = 0;
76 
77  public bool NoRecalculoStockTrasRecibir { get; set; } = false;
78 
79  public bool BackupSel { get; set; } = false;
80  public string BackupPath { get; set; } = "";
81  public int BackupNumArchivos { get; set; } = 0;
82 
83  public string Hora_Envio { get; set; } = "";
84  public string Hora_Recepcion { get; set; } = "";
85  public string Hora_CargaIni { get; set; } = "";
86 
87  public int Delete_Cen_Mant { get; set; } = 1;
88  public int Delete_Cen_Doc { get; set; } = 1;
89 
90  public string Serie_Central { get; set; } = "";
91 
92  public string Serie_Sucursal { get; set; } = "";
93  public string Almacen_Sucursal { get; set; } = "";
94  public bool FiltroPorAlmacen { get; set; } = false;
95 
96  public string CuentaOneDrive { get; set; } = "";
97  public string RutaOneDrive { get; set; } = "";
98 
99  public bool ConCargaInicial { get; set; } = false;
100 
104  public string CodigoConfiguracion
105  {
106  get
107  {
108  return _CodigoConfiguracion;
109  }
110  set
111  {
112  bool llCambiado = (_CodigoConfiguracion != value);
113 
114  _CodigoConfiguracion = value;
115 
116  if (llCambiado)
117  {
118  Dictionary<string, object> tablaMultconf = _asistenteOfflineDA.GetMulticonf(value);
119  //DB.SQLREGValor("MULTCONF", "CODIGO", value, "OFFLINE");
120 
121  IdConf = Convert.ToInt16(tablaMultconf["idconf"]);
122 
123  if (tablaMultconf["conexion"].ToString() == "0")
124  {
125  string cadenaEncriptada = tablaMultconf["cfg_ftp"].ToString().Trim();
126 
127  string cadenaDesencriptada = toolsOffline.Cadena_Desencriptar(cadenaEncriptada);
128 
129  var trozos = cadenaDesencriptada.Split('~');
130 
131  if (trozos.Length == 7)
132  {
133  ftp_user_data = new FtpUserData();
134  ftp_user_data.server = trozos[0].Trim();
135  ftp_user_data.user = trozos[1].Trim();
136  ftp_user_data.password = trozos[2].Trim();
137  ftp_user_data.port = Convert.ToDecimal(trozos[3]);
138  ftp_user_data.proxy = trozos[4].Trim();
139  ftp_user_data.rutaserv = trozos[5].Trim();
140  ftp_user_data.ftp_activo = trozos[6].Trim().ToUpper() == "SI";
141  }
142  else if (trozos.Length == 9)
143  {
144  ftp_user_data = new FtpUserData();
145  ftp_user_data.server = trozos[0].Trim();
146  ftp_user_data.user = trozos[1].Trim();
147  ftp_user_data.password = trozos[2].Trim();
148  ftp_user_data.port = Convert.ToDecimal(trozos[3]);
149  ftp_user_data.proxy = trozos[4].Trim();
150  ftp_user_data.rutaserv = trozos[5].Trim();
151  ftp_user_data.ftp_activo = trozos[6].Trim().ToUpper() == "SI";
152  ftp_user_data.use_ssl_tls = trozos[7].Trim().ToUpper() == "SI";
153  ftp_user_data.validate_server_cert = trozos[8].Trim().ToUpper() == "SI";
154  }
155 
156 
157  IsFTP = true;
158  }
159  else
160  {
161  ftp_user_data = null;
162  IsOneDrive = true;
163  }
164 
165  OfflineUpAndDown.IdConf = IdConf;
166 
167  NoRecalculoStockTrasRecibir = Convert.ToBoolean(tablaMultconf["rec_stock"]);
168 
169  cargarSucursales();
170  }
171  }
172  }
173  private string _CodigoConfiguracion = string.Empty;
174 
178  public bool IsCentral
179  {
180  get { return TipoOffline == 1; }
181  set
182  {
183  if (value)
184  TipoOffline = 1;
185  else
186  TipoOffline = 2;
187  }
188  }
189 
193  public bool IsSucursal
194  {
195  get { return TipoOffline == 2; }
196  set
197  {
198  if (value)
199  TipoOffline = 2;
200  else
201  TipoOffline = 1;
202  }
203  }
204 
208  public bool IsFTP
209  {
210  get { return TipoComunicacion == 2; }
211  set
212  {
213  if (value)
214  TipoComunicacion = 2;
215  else
216  TipoComunicacion = 1;
217  }
218  }
219 
223  public bool IsOneDrive
224  {
225  get { return TipoComunicacion == 1; }
226  set
227  {
228  if (value)
229  TipoComunicacion = 1;
230  else
231  TipoComunicacion = 2;
232  }
233  }
234 
235  protected internal int TipoRecepcion = 1;
236  public bool IsAutomatica
237  {
238  get { return TipoRecepcion == 1; }
239  set
240  {
241  if (value)
242  TipoRecepcion = 1;
243  else
244  TipoRecepcion = 2;
245  }
246  }
247 
248  public bool IsPersonalizada
249  {
250  get { return TipoRecepcion == 2; }
251  set
252  {
253  if (value)
254  TipoRecepcion = 2;
255  else
256  TipoRecepcion = 1;
257  }
258  }
259 
260 
261  public string CodigoSucursal
262  {
263  get
264  {
265  return _CodigoSucursal;
266  }
267  set
268  {
269  _CodigoSucursal = value;
270 
271  if (!string.IsNullOrEmpty(value))
272  {
273  Serie_Sucursal = GetSerieDefectoCurrentSucursal();
274  Almacen_Sucursal = GetAlmacenDefectoCurrentSucursal();
275  }
276  }
277  }
278  private string _CodigoSucursal = "";
279 
283  public bool EnviarImagenes
284  {
285  get
286  {
287  return _EnviarImagenes;
288  }
289  set
290  {
291  _EnviarImagenes = value;
292  EnvioImagenes = (value ? 0 : 1);
293  }
294  }
295  private bool _EnviarImagenes = false;
296 
300  public List<string> Sucursales
301  {
302  get
303  {
304  List<string> sucursales = new List<string>();
305  foreach (DataRow row in dtSucursales.Rows)
306  {
307  if (row["sel"] != DBNull.Value && Convert.ToBoolean(row["sel"]))
308  {
309  if (IsCentral || (IsSucursal && row["codigo"].ToString() == _asistenteOfflineDA.CodigoSucursalActual()))
310  {
311  sucursales.Add(row["codigo"].ToString());
312  }
313  }
314  }
315  return sucursales;
316  }
317  }
318 
322  public DateTime FechaConf
323  {
324  get
325  {
326  if (_FechaConf == null)
327  {
328  _FechaConf = GetDate();
329  }
330  return _FechaConf;
331  }
332  set
333  {
334  _FechaConf = value;
335  }
336  }
337  private DateTime _FechaConf; // = GetDate();
338 
342  public DateTime FechaInicial
343  {
344  get
345  {
346  if (_FechaInicial == null)
347  {
348  _FechaInicial = GetDate();
349  }
350  return _FechaInicial;
351  }
352  set
353  {
354  if (_FechaInicial != value)
355  {
356  if (!ValidarQueFechasSonCorrectas(value, FechaFinal))
357  {
358  value = FechaFinal;
359  }
360 
361  if (IsAutomatica)
362  {
363  _FechaInicial = value;
364  }
365  else
366  {
367  _FechaInicial = value.Date;
368  }
369  }
370  }
371  }
372  private DateTime _FechaInicial; // = GetDate();
373 
377  public DateTime FechaFinal
378  {
379  get
380  {
381  return _FechaFinal;
382  }
383  set
384  {
385  if (value < new DateTime(1900, 1, 1)) //CCR 179195: Si en lugar de null llega una fecha 1700 al vaciar la fecha en la parte visual
386  {
387  value = value.Date.AddHours(23).AddMinutes(59).AddSeconds(59);
388  }
389 
390  if (_FechaFinal != value)
391  {
392  if (!ValidarQueFechasSonCorrectas(_FechaInicial, value))
393  {
394  value = _FechaFinal;
395  }
396 
397  _FechaFinal = value.Date.AddHours(23).AddMinutes(59).AddSeconds(59);
398  }
399  }
400  }
401  private DateTime _FechaFinal = DateTime.Today.AddHours(23).AddMinutes(59).AddSeconds(59);
402 
403 
404  public bool Incidencias
405  {
406  get { return Finalizacion == 2; }
407  set
408  {
409  if (value)
410  {
411  Finalizacion = 2;
412  }
413  else
414  {
415  Finalizacion = 1;
416  }
417  }
418  }
419  private int Finalizacion = 1; // 1 Finaliza Correctamente - 2 Finaliza con incidencias
420 
421  public bool Error
422  {
423  get
424  {
425  return _Error;
426  }
427  set
428  {
429  _Error = value;
430  }
431  }
432  private bool _Error = false;
433 
437  public string _TextStepDetalle
438  {
439  set
440  {
441  if (!string.IsNullOrEmpty(value))
442  {
443  _cTextStepDetalle = value;
444  ActualizarProgresoDetalle();
445  }
446  }
447  get { return _cTextStepDetalle; }
448  }
449  private string _cTextStepDetalle = "";
450 
454  public string _TextStepProgreso
455  {
456  set
457  {
458  if (!string.IsNullOrEmpty(value))
459  {
460  _cTextStepProgreso = value;
461  }
462  }
463  get { return _cTextStepProgreso; }
464  }
465  private string _cTextStepProgreso = "";
466 
470  public decimal _PorcenProgreso
471  {
472  set
473  {
474  _lnPorcenProgreso = value;
475  ActualizarBarraProgreso();
476  }
477  get { return _lnPorcenProgreso; }
478  }
479  private decimal _lnPorcenProgreso = 0.0M;
480 
481 
482  #endregion Propiedades
483 
484 
485 
489  public DataTable dtSucursales = new DataTable();
490 
491  #region Constructors
492  public AsistenteOffBase()
493  {
494  _asistenteOfflineDA = DependencyInjector.Instance.Retrieve<IAsistenteOfflineDA>();
495  }
496  #endregion Constructors
497  public bool ValidarQueFechasSonCorrectas(Nullable<DateTime> tdFechaIni, Nullable<DateTime> tdFechaFin)
502  {
503  if (!tdFechaIni.HasValue && !tdFechaFin.HasValue)
504  return true; //Las dos a null => Ok
505 
506  bool llOK = true;
507 
508  if (tdFechaIni.HasValue && tdFechaFin.HasValue) //Si tengo las dos fechas
509  {
510  //Final ha de ser mayor que inicio
511  int lnResult = DateTime.Compare(tdFechaIni.Value, tdFechaFin.Value);
512  if (lnResult > 0)
513  {
514  ew.functions.FUNCTIONS._MessageBox("La fecha final no puede ser inferior a la inicial.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Warning);
515  return false;
516  }
517  return true;
518  }
519  else
520  {
521  if (!tdFechaIni.HasValue && tdFechaFin.HasValue) //Si tengo fin pero no origen
522  {
523  ew.functions.FUNCTIONS._MessageBox("No se puede definir la fecha fin sin haber definido la inicial.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Warning);
524  return false;
525  }
526  }
527 
528  return llOK;
529  }
530 
531  public void Cargar_Variables()
532  {
533  DataTable tablaDatos = _asistenteOfflineDA.GetVariables(IdConf.ToString());
534  if (tablaDatos.Rows.Count == 0 || tablaDatos == null)
535  {
536  return;
537  }
538 
539  foreach (DataRow variable in tablaDatos.Rows)
540  {
541  switch (variable["VARIABLE"].ToString().Trim().ToUpper())
542  {
543  case "TIPOOFFLINE":
544  if (variable["VALOR"].ToString().Trim().ToUpper() == "CENTRAL")
545  TipoOffline = 1;
546  else
547  TipoOffline = 2;
548  break;
549 
550  case "CODIGOSUCURSAL":
551  CodigoSucursal = variable["VALOR"].ToString().Trim();
552  break;
553 
554  case "BACKUP_RECEP":
555  {
556  var trozos = variable["VALOR"].ToString().Split('|');
557 
558  if (trozos.Length == 3)
559  {
560  BackupSel = trozos[0].Trim().ToUpper() == ".T.";
561  BackupPath = trozos[1].Trim();
562  BackupNumArchivos = Convert.ToInt32(trozos[2]);
563  }
564  else
565  {
566  // TODO
567  // La configuración del backup de recepción se definirá en otro lugar
568  }
569  break;
570  }
571  case "ENVIARIMAGENES":
572  EnviarImagenes = variable["VALOR"].ToString().Trim() == ".T.";
573  break;
574  case "FILTROPORALMACEN":
575  FiltroPorAlmacen = variable["VALOR"].ToString().Trim() == ".T.";
576  break;
577  case "TERMINALSEGURIDAD":
578  TerminalSeguridad = variable["VALOR"].ToString().Trim() == ".T.";
579  break;
580  case "HORA_ENVIO":
581  Hora_Envio = variable["VALOR"].ToString().Trim();
582  break;
583  case "HORA_RECEPCION":
584  Hora_Recepcion = variable["VALOR"].ToString().Trim();
585  break;
586  case "HORA_CARGAINI":
587  Hora_CargaIni = variable["VALOR"].ToString().Trim();
588  break;
589  case "DELETE_CEN_MANT":
590  Delete_Cen_Mant = variable["VALOR"].ToString().Trim() == ".T." ? 1 : 2;
591  break;
592  case "DELETE_CEN_DOC":
593  Delete_Cen_Doc = variable["VALOR"].ToString().Trim() == ".T." ? 1 : 2;
594  break;
595  case "SERIECENTRAL":
596  Serie_Central = variable["VALOR"].ToString().Trim();
597  break;
598  case "NORECALCULOSTOCKIMP":
599  NoRecalculoStockTrasRecibir = variable["VALOR"].ToString().Trim() == ".T.";
600  break;
601  }
602  }
603 
604  string lcUsuario = Convert.ToString(EW_GLOBAL._GetVariable("wc_usuario")).TrimEnd();
605 
606  if (lcUsuario == "SUPERVISOR" || lcUsuario == "OFFLINE")
607  {
608  CodigoConfiguracion = _asistenteOfflineDA.GetCodigoConfiguracion(IdConf.ToString());
609  //DB.SQLValor("MULTCONF", "IDCONF", IdConf.ToString(), "CODIGO", "OFFLINE").ToString();
610  }
611  else
612  {
613  string codConf = _asistenteOfflineDA.GetCodigoConfiguracion(IdConf.ToString(), lcUsuario);
614  if (!string.IsNullOrEmpty(codConf))
615  {
616  CodigoConfiguracion = codConf;
617  }
618 
619  }
620 
621  if (TipoOffline != 1)
622  {
623  sucursal = _asistenteOfflineDA.GetSucursal(IdConf.ToString(), CodigoSucursal) ?? null;
624  }
625  }
626 
627  private void cargarSucursales()
628  {
629  DataTable tablaDatos = _asistenteOfflineDA.GetSucursales(IdConf);
630 
631  _Sucursales.Clear();
632  foreach (DataRow ldrFila in tablaDatos.Rows)
633  {
634  Sucursales suc = new Sucursales(ldrFila);
635 
636  if (IsCentral || (IsSucursal && suc._codigo == _asistenteOfflineDA.CodigoSucursalActual()))
637  {
638  _Sucursales.Add(suc);
639  }
640  }
641  }
642 
647  public bool ComprobacionesConfiguradoCentraloSucursal()
648  {
649  bool ret = true;
650 
651  ret = GrupoEmpresaConfiguradoComoCentraloSucursal();
652 
653  return ret;
654  }
655 
660  public bool ComprobacionesCreadoConfiguracion(bool lbAsistConf)
661  {
662  bool ret = true;
663 
664  ret = SeHaCreadoConfiguracion(lbAsistConf);
665 
666  return ret;
667  }
668 
673  public bool ComprobacionesConfigSoloRecepcion()
674  {
675  return _asistenteOfflineDA.IsConfigSoloTipoRecepcion();
676  }
677 
682  public bool ComprobacionesConfigSoloEnvio()
683  {
684  return _asistenteOfflineDA.IsConfigSoloTipoEnvio();
685  }
686 
691  public bool ComprobacionesUsuarioConfiguracion()
692  {
693  string lcUsuario = Convert.ToString(EW_GLOBAL._GetVariable("wc_usuario")).TrimEnd();
694  if (lcUsuario != "SUPERVISOR" && lcUsuario != "OFFLINE" && lcUsuario != "SAGESYSTEM")
695  {
696  return _asistenteOfflineDA.IsUsuarioConfiguracion(lcUsuario);
697  }
698 
699  return true;
700 
701  //if (lcUsuario != "SUPERVISOR" && lcUsuario != "OFFLINE")
702  //{
703  // DataTable ldtUsuario = new DataTable();
704  // DB.SQLExec("SELECT USUARIO, IDCONF FROM " + DB.SQLDatabase("OFFLINE", "USERCONF") + " WHERE USUARIO = " + DB.SQLString(lcUsuario) + " AND VALOR = 1", ref ldtUsuario);
705 
706  // return ldtUsuario.Rows.Count > 0;
707  //}
708  //return true;
709  }
710 
715  public bool ValidacionEjercicioPredet()
716  {
717  string lcAny = _asistenteOfflineDA.GetEjercicioPredeterminado();
718 
719  if (lcAny == Convert.ToString(EW_GLOBAL._GetVariable("wc_any")))
720  {
721  return true;
722  }
723 
724  return false;
725  }
726 
731  public string GetEjercicioPredeterminado()
732  {
733  return _asistenteOfflineDA.GetEjercicioPredeterminado();
734  }
735 
736  public DataTable GetEjerciciosOffline()
737  {
738  return _asistenteOfflineDA.GetEjerciciosOffline();
739  }
740 
747  public DataTable GetClaves(Dictionary<Int32, string> claves, string where = "")
748  {
749  StringBuilder sb = new StringBuilder();
750  int i = 0;
751  foreach (KeyValuePair<int, string> item in claves)
752  {
753  sb.Append("'" + item.Value.TrimEnd() + "'");
754  if (i < claves.Count - 1)
755  {
756  sb.Append(",");
757  }
758  i++;
759  }
760  string sClaves = "(" + sb.ToString() + ")";
761  return _asistenteOfflineDA.GetClaves(sClaves, where);
762  //DataTable dtRet = new DataTable();
763  //string lcSql = "Select * from " + DB.SQLDatabase("offline", "tabrelnet") +
764  // " where clave in " + sClaves;
765  //if (!string.IsNullOrEmpty(where))
766  //{
767  // lcSql += where;
768  //}
769 
770  //DB.SQLExec(lcSql, ref dtRet);
771  //return dtRet;
772  }
773 
778  public bool ValidarFechas()
779  {
780  return _asistenteOfflineDA.IsConfigSoloTipoRecepcion();
781  }
782 
788  public DataTable Datos_TabNetConf(string codigoConfiguracion)
789  {
790  return _asistenteOfflineDA.Datos_TabNetConf(codigoConfiguracion);
791  }
792 
797  public virtual bool AlmenosUnoMarcadaActivaPaso1()
798  {
799  bool ret = false;
800  foreach (DataRow row in dtSucursales.Rows)
801  {
802  if (row["sel"] != DBNull.Value && Convert.ToBoolean(row["sel"]) && Convert.ToBoolean(row["activa"]))
803  {
804  ret = true;
805  break;
806  }
807  }
808  return ret;
809  }
810 
811 
816  public DataTable GetSucursales()
817  {
818  DataTable ret = dtSucursales.Clone();
819 
820  foreach (DataRow row in dtSucursales.Rows)
821  {
822  if (row["sel"] != DBNull.Value && Convert.ToBoolean(row["sel"]) && Convert.ToInt32(row["activa"]) != 0)
823  {
824  ret.ImportRow(row);
825  }
826  }
827 
828  return ret;
829  }
830 
835  public Dictionary<int, int> ObtenerPrioridades()
836  {
837  // Obtenemos las prioridades según selección central o sucursal
838  DataTable datos = _asistenteOfflineDA.GetPrioridades();
839  Dictionary<int, int> dicPrioridades = new Dictionary<int, int>();
840 
841  //string lcSql = " SELECT IDTABREL, PRIO_DATOS FROM " + DB.SQLDatabase("OFFLINE", "PRIORIDAD");
842 
843  //DB.SQLExec(lcSql, ref datos);
844 
845  foreach (DataRow rowPrioridad in datos.Rows)
846  {
847  dicPrioridades.Add(Convert.ToInt32(rowPrioridad["IDTABREL"]), Convert.ToInt32(rowPrioridad["PRIO_DATOS"]));
848  }
849 
850  return dicPrioridades;
851  }
852 
853  internal DateTime GetDate()
854  {
855  //DateTime fecha = DateTime.Now;
856  //DataTable ldtEjer = new DataTable();
857  //string lcSqlEjer = " SELECT MIN(PERIODOINI) AS FECHAINI FROM " + DB.SQLDatabase("COMUNES", "EJERCICI");
858  //if (DB.SQLExec(lcSqlEjer, ref ldtEjer) && ldtEjer.Rows.Count > 0)
859  //{
860  // fecha = Convert.ToDateTime(ldtEjer.Rows[0]["fechaini"]);
861  //}
862  return _asistenteOfflineDA.GetFechaIni();
863  }
864 
865  internal bool SeHaCreadoConfiguracion(bool lbAsistConf)
866  {
867  //DataTable ldtDatos = new DataTable();
868  //string lcSqlMultConf = " SELECT IDCONF, TIPO FROM " + DB.SQLDatabase("OFFLINE", "MULTCONF") + " WHERE TIPO = 0 OR TIPO = 1";
869  //if (DB.SQLExec(lcSqlMultConf, ref ldtDatos) && ldtDatos.Rows.Count > 0)
870  //{
871  // DataTable dtTemp = new DataTable();
872  // string lcSql = "Select count(*) as total from " + DB.SQLDatabase("OFFLINE", "TABRELCONF");
873  // DB.SQLExec(lcSql, ref dtTemp);
874 
875  // return dtTemp.Rows.Count > 0 && Convert.ToInt32(dtTemp.Rows[0]["total"]) > 0;
876  //}
877 
878  return _asistenteOfflineDA.SeHaCreadoConfiguracion(lbAsistConf);
879  }
880 
881  internal bool GrupoEmpresaConfiguradoComoCentraloSucursal()
882  {
883  return !string.IsNullOrEmpty(Convert.ToString(ew.db.DB.SQLValor("VARIABLES", "VARIABLE", "TIPOOFFLINE", "VALOR", "OFFLINE")).Trim().ToUpper());
884  }
885 
886  internal bool Result_LogComunicaciones(ref DataTable table, DateTime startProces, int resultado = 1)
887  {
888  return _asistenteOfflineDA.Result_LogComunicaciones(ref table, startProces, resultado);
889  }
890 
891  internal bool Result_LogComunicaciones_Error(ref DataTable table, DateTime startProces)
892  {
893  return _asistenteOfflineDA.Result_LogComunicaciones_Error(ref table, startProces);
894  }
895 
896  internal Dictionary<string, int> Result_LogComunicaciones_IdLog(ref DataTable table, string idLog)
897  {
898  return _asistenteOfflineDA.Result_LogComunicaciones_IdLog(ref table, idLog);
899  }
900 
901  #region Metodos privados
902 
903 
904  private void ActualizarProgresoDetalle()
905  {
906  if (_Mostrar_Progreso_Async != null)
907  _Mostrar_Progreso_Async(_TextStepDetalle);
908 
909  }
910 
911  private void ActualizarBarraProgreso()
912  {
913  if (_Porcen_Progreso_Async != null)
914  _Porcen_Progreso_Async(_PorcenProgreso, _TextStepDetalle);
915 
916  }
917 
918  private string GetSerieDefectoCurrentSucursal()
919  {
920  //DataTable dtSeries = new DataTable();
921 
922  //string tcSql = string.Format("SELECT * FROM {0} ", DB.SQLDatabase("OFFLINE", "SUCURLET"));
923  //DB.SQLExec(tcSql, ref dtSeries);
924 
925  //var res = dtSeries.AsEnumerable().Where(S => S["SUCURSAL"].ToString() == this.CodigoSucursal).FirstOrDefault();
926 
927  //if (res != null)
928  // return res["LETRA"].ToString();
929 
930  return _asistenteOfflineDA.GetSerieDefectoCurrentSucursal(CodigoSucursal);
931  }
932 
933  private string GetAlmacenDefectoCurrentSucursal()
934  {
935  //DataTable dtAlm = new DataTable();
936 
937  //string tcSql = string.Format("SELECT * FROM {0} ", DB.SQLDatabase("OFFLINE", "SUCURALM"));
938  //DB.SQLExec(tcSql, ref dtAlm);
939 
940  //var res = dtAlm.AsEnumerable().Where(S => S["SUCURSAL"].ToString() == this.CodigoSucursal).FirstOrDefault();
941 
942  //if (res != null)
943  // return res["ALMACEN"].ToString();
944 
945  return _asistenteOfflineDA.GetAlmacenDefectoCurrentSucursal(CodigoSucursal);
946  }
947  #endregion
948  }
949 }
bool Result_LogComunicaciones(ref DataTable table, DateTime startProces, int resultado=1)
string GetAlmacenDefectoCurrentSucursal(string codigoSucursal)
Obtiene el almacen por defecto de la sucursal
DataTable GetSucursales(int idConf)
Obtiene las sucursales con esa configuración
bool IsConfigSoloTipoEnvio()
Todas las configuraciones son de tipo envio
string CodigoSucursalActual()
Devuelve el código de la sucursal actual
object Retrieve(Type T)
Resuelve objeto de tipo T
Es como el tipo de entrada asientos pero por negocio, sin formulario, pq quiero que me haga las propu...
DateTime GetFechaIni()
Obtiene fecha inicio de ejercicio
DataTable Datos_TabNetConf(string codigoConfiguracion)
DataTable GetClaves(string claves, string where)
Obtener claves
Dictionary< string, object > GetMulticonf(string codigo)
Devuelve datos de multiconf
bool IsUsuarioConfiguracion(string usuario)
Tiene comfiguracion ese usuario
bool Result_LogComunicaciones_Error(ref DataTable table, DateTime startProces)
DataRow GetSucursal(string idConf, string codigoSucursal)
Obtiene datos de la sucursal
string GetEjercicioPredeterminado()
Devuelve el ejercicio prederminado
string GetCodigoConfiguracion(string idConf)
Obtiene codigo de configuración
DataTable GetVariables(string idConf)
Obtiene registro de variables
bool IsConfigSoloTipoRecepcion()
Todas las configuraciones son de tipo recepción
DataTable GetPrioridades()
Obtiene las prioridades
Dictionary< string, int > Result_LogComunicaciones_IdLog(ref DataTable table, string idLog)
string GetSerieDefectoCurrentSucursal(string codigoSucursal)
Obtiene la serie por defecto de la sucursal
bool SeHaCreadoConfiguracion(bool lbAsistConf)
Si se creó configuración
DataTable GetEjerciciosOffline()
Obtener los ejercicios del OFFLINE
Clase Inyector de dependencias para resolver las dependencias