/// <summary> /// Obtiene los parametros para realizar el guardado de la orden de reimplante /// </summary> /// <param name="orden"></param> /// <returns></returns> internal static Dictionary <string, object> ObtenerParametrosGuardado(OrdenReimplanteInfo orden) { Dictionary <string, object> parametros; try { Logger.Info(); var xml = new XElement("ROOT", from detalle in orden.CorralesDestino select new XElement("CorralesDestino", new XElement("CorralesDestinoID", detalle.CorralID), new XElement("PuntaChica", Convert.ToInt16(detalle.PuntaChica)) )); parametros = new Dictionary <string, object> { { "@OrganizacionID", orden.OrganizacionId }, { "@Fecha", orden.FechaReimplanteSeleccionado }, { "@LoteId", orden.LoteId }, //{"@CorralDestinoId", orden.CorralDestinoSeleccionado.CorralID}, { "@ProductoId", orden.ProductoSeleccionado.ProductoId }, { "@UsuarioId", orden.UsuarioCreacion }, { "@XMLCorralDestino", xml.ToString() }, }; } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } return(parametros); }
/// <summary> /// Almacena una orden de programacion de reimplante /// </summary> /// <param name="orden"></param> /// <returns></returns> internal int GuardarOrdenReimplante(OrdenReimplanteInfo orden) { int retValue = -1; try { Logger.Info(); var parametros = AuxProgramacionReimplanteDAL.ObtenerParametrosGuardado(orden); retValue = Create("ProgramacionReimplante_Crear", parametros); } catch (SqlException ex) { Logger.Error(ex); throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex); } catch (DataException ex) { Logger.Error(ex); throw new ExcepcionServicio(MethodBase.GetCurrentMethod(), ex); } catch (Exception ex) { Logger.Error(ex); throw new ExcepcionDesconocida(MethodBase.GetCurrentMethod(), ex); } return(retValue); }