public ActionResult GrabarSerie(JsonHeader collection)
        {
            Dictionary <string, string> headerDictionary  = WebHelper.JsonToDictionary(collection.Header);
            Dictionary <string, string> detailDictionary  = WebHelper.JsonToDictionary(collection.Detail);
            JsonResultMessage           jsonResultMessage = new JsonResultMessage();

            try
            {
                SerieDTO serieDTO = new SerieDTO();
                serieDTO.SerieId              = Convert.ToInt32(detailDictionary["SerieId"]);
                serieDTO.AlmacenId            = Convert.ToInt32(headerDictionary["AlmacenId"]);
                serieDTO.DocumentoComercialId = Convert.ToInt32(detailDictionary["DocumentoComercialId"]);
                serieDTO.NumeroSerie          = Convert.ToString(detailDictionary["NumeroSerie"]);
                serieDTO.NumeroLinea          = Convert.ToInt32(detailDictionary["NumeroLinea"]);
                serieDTO.FormatoDocumento     = Convert.ToString(detailDictionary["FormatoDocumento"]);
                serieDTO.IgvSn             = Convert.ToString(detailDictionary["IgvSn"]);
                serieDTO.Observacion       = Convert.ToString(detailDictionary["Observacion"]);
                serieDTO.Estado            = EstadoConstante.ACTIVO;
                serieDTO.UsuarioCreacionId = 1;
                serieDTO.FechaCreacion     = DateTime.Now;

                if (collection.EditAction != EditActionConstant.EDIT)
                {
                    serieService.Create(serieDTO);
                }
                else
                {
                    serieService.Update(serieDTO);
                }


                jsonResultMessage.message = "Numero serie para esta almacen grabado satisfactoriamente.";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(jsonResultMessage));
        }