コード例 #1
0
ファイル: CargosWSDAL.cs プロジェクト: rjmnz91/ZGM-MIT
        public static DataSet GetFormatoFechaSRegional(DataSet ds)
        {
            Log.Info(Traza.INICIO + Traza.GetParameters(ds));
            Log.Debug(Traza.GetDataSetValues("ds", ds));

            try
            {
                int i = 0;


                for (i = 0; i <= ds.Tables.Count - 1; i++)
                {
                    foreach (DataColumn column in ds.Tables[i].Columns)
                    {
                        if (object.ReferenceEquals(column.DataType, System.Type.GetType("System.DateTime")))
                        {
                            column.DateTimeMode = DataSetDateTime.Unspecified;
                        }
                    }
                }

                Log.Info(string.Format(Traza.RETURN, Traza.GetDataSetValues("ds", ds)));
                return(ds);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Log.Info(Traza.FINAL);
            }
        }
コード例 #2
0
ファイル: CargosWSDAL.cs プロジェクト: rjmnz91/ZGM-MIT
        public static DataSet GetDataSetCargos(Int64 IdCargo, string StrTienda, DateTime FechaSesion, Int16 Retif)
        {
            Log.Info(Traza.INICIO + Traza.GetParameters(IdCargo, StrTienda, FechaSesion, Retif));

            try
            {
                SqlCommand     SqlDatosCargos = default(SqlCommand);
                SqlDataAdapter Adaptador      = default(SqlDataAdapter);
                DataSet        Ds             = new DataSet();
                SqlConnection  connection     = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ConnectionString);

                SqlDatosCargos             = new SqlCommand();
                SqlDatosCargos.CommandType = CommandType.StoredProcedure;
                SqlDatosCargos.CommandText = "WS_UpCargosOnline";
                SqlDatosCargos.Connection  = connection;

                SqlParameter objParametro = new SqlParameter();
                objParametro.ParameterName = "@IdCargo";
                objParametro.SqlDbType     = SqlDbType.Int;
                objParametro.Value         = IdCargo;

                SqlDatosCargos.Parameters.Add(objParametro);

                objParametro = new SqlParameter();
                objParametro.ParameterName = "@IdTienda";
                objParametro.SqlDbType     = SqlDbType.VarChar;
                objParametro.Size          = 10;
                objParametro.Value         = StrTienda;

                SqlDatosCargos.Parameters.Add(objParametro);

                objParametro = new SqlParameter();
                objParametro.ParameterName = "@Fecha";
                objParametro.SqlDbType     = SqlDbType.DateTime;
                objParametro.Value         = FechaSesion;

                SqlDatosCargos.Parameters.Add(objParametro);

                objParametro = new SqlParameter();
                objParametro.ParameterName = "@Retif";
                objParametro.SqlDbType     = SqlDbType.Int;
                objParametro.Value         = Retif;

                SqlDatosCargos.Parameters.Add(objParametro);

                Adaptador = new SqlDataAdapter(SqlDatosCargos);

                Adaptador.Fill(Ds);

                SqlDatosCargos.Connection.Close();

                Log.Info(string.Format(Traza.RETURN, Traza.GetDataSetValues("Ds", Ds)));
                return(Ds);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Log.Info(Traza.FINAL);
            }
        }