예제 #1
0
        /// <summary>
        /// Envia los cambios del twf_TareasDataset a la base de datos.
        /// </summary>
        public static void Update(twf_TareasDataset dataSet)
        {
            ApplicationAssert.Check(dataSet != null, "El argumento dataSet no debe ser nulo.", ApplicationAssert.LineNumber);
            ApplicationAssert.Check(dataSet.twf_Tareas.Rows.Count > 0, "La tabla dataSet.twf_TareasDataTable debe poseer alguna fila.", ApplicationAssert.LineNumber);

            mz.erp.dataaccess.twf_Tareas.Update(dataSet);
        }
예제 #2
0
        public static twf_TareasDataset GetListTareas(long idProceso)
        {
            twf_TareasDataset data = new twf_TareasDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "twf_Tareas");

            SqlCommand cmd = new SqlCommand("Pr_twf_ProcesosTareas_GetListTareas", dbhelper.Connection.GetConnection());

            cmd.Parameters.Add(new SqlParameter("@IdProceso", SqlDbType.BigInt));
            cmd.Parameters["@IdProceso"].Value = idProceso;

            cmd.CommandType = CommandType.StoredProcedure;

            adapter.SelectCommand = cmd;
            try
            {
                adapter.Fill(data);
            }
            catch (SqlException e)
            {
                System.Diagnostics.Debug.WriteLine(e.ToString());
            }

            return(data);
        }
예제 #3
0
        public static long GetIdTaskByName(string _nameTask)
        {
            twf_TareasDataset _data = GetList(long.MinValue, _nameTask, long.MinValue, DateTime.MinValue, long.MinValue, new byte[] {}, long.MinValue, Guid.NewGuid(), null);
            long idTask             = long.MinValue;

            if (_data.twf_Tareas.Rows.Count > 0)
            {
                idTask = ((twf_TareasDataset.twf_TareasRow)_data.twf_Tareas.Rows[0]).IdTarea;
            }
            return(idTask);
        }
예제 #4
0
        public static DataSet GetList([SearchParameterInfo("IdTarea")] long IdTarea,
                                      [SearchParameterInfo("Descripcion")] string Descripcion,
                                      [SearchParameterInfo("IdConexion")] long IdConexion,
                                      [SearchParameterInfo("FechaCreacion")] DateTime FechaCreacion,
                                      [SearchParameterInfo("IdConexionCreacion")] long IdConexionCreacion,
                                      [SearchParameterInfo("UltimaModificacion")] byte[] UltimaModificacion,
                                      [SearchParameterInfo("IdConexionUltimaModificacion")] long IdConexionUltimaModificacion,
                                      [SearchParameterInfo("RowId")] Guid RowId,
                                      [SearchParameterInfo("Observaciones")] string Observaciones
                                      )
        {
            twf_TareasDataset data = mz.erp.businessrules.twf_Tareas.GetList(IdTarea, Descripcion, IdConexion, FechaCreacion, IdConexionCreacion, UltimaModificacion, IdConexionUltimaModificacion, RowId, Observaciones);

            return(( DataSet )data);
        }
예제 #5
0
        public static twf_TareasDataset.twf_TareasRow GetByPk(long IdTarea)
        {
            twf_TareasDataset data = new twf_TareasDataset();

            SqlCommand cmd = new SqlCommand("Pr_twf_Tareas_GetByPk", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdTarea", SqlDbType.BigInt));
            cmd.Parameters["@IdTarea"].Value = IdTarea;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.TableMappings.Add("Table", "twf_Tareas");

            adapter.Fill(data);

            if (data.twf_Tareas.Rows.Count == 1)
            {
                return((twf_TareasDataset.twf_TareasRow)data.twf_Tareas.Rows[0]);
            }

            return(null);
        }
예제 #6
0
        public static twf_TareasDataset GetList(long IdTarea, string Descripcion, long IdConexion, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, Guid RowId, string Observaciones)
        {
            twf_TareasDataset data = new twf_TareasDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "twf_Tareas");

            SqlCommand cmd = new SqlCommand("Pr_twf_Tareas_Search", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdTarea", SqlDbType.BigInt));
            if (IdTarea == long.MinValue)
            {
                cmd.Parameters["@IdTarea"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdTarea"].Value = IdTarea;
            }
            cmd.Parameters.Add(new SqlParameter("@Descripcion", SqlDbType.VarChar));
            cmd.Parameters["@Descripcion"].Value = Descripcion;
            cmd.Parameters.Add(new SqlParameter("@IdConexion", SqlDbType.BigInt));
            if (IdConexion == long.MinValue)
            {
                cmd.Parameters["@IdConexion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdConexion"].Value = IdConexion;
            }
            cmd.Parameters.Add(new SqlParameter("@FechaCreacion", SqlDbType.DateTime));
            cmd.Parameters["@FechaCreacion"].Value = System.DBNull.Value;
            cmd.Parameters.Add(new SqlParameter("@IdConexionCreacion", SqlDbType.BigInt));
            if (IdConexionCreacion == long.MinValue)
            {
                cmd.Parameters["@IdConexionCreacion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdConexionCreacion"].Value = IdConexionCreacion;
            }
            cmd.Parameters.Add(new SqlParameter("@UltimaModificacion", SqlDbType.Timestamp));
            cmd.Parameters["@UltimaModificacion"].Value = System.DBNull.Value;
            cmd.Parameters.Add(new SqlParameter("@IdConexionUltimaModificacion", SqlDbType.BigInt));
            if (IdConexionUltimaModificacion == long.MinValue)
            {
                cmd.Parameters["@IdConexionUltimaModificacion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdConexionUltimaModificacion"].Value = IdConexionUltimaModificacion;
            }
            cmd.Parameters.Add(new SqlParameter("@RowId", SqlDbType.UniqueIdentifier));
            cmd.Parameters["@RowId"].Value = System.DBNull.Value;
            cmd.Parameters.Add(new SqlParameter("@Observaciones", SqlDbType.VarChar));
            cmd.Parameters["@Observaciones"].Value = Observaciones;

            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
예제 #7
0
        public static twf_TareasDataset GetList()
        {
            twf_TareasDataset data = new twf_TareasDataset();

            return(( twf_TareasDataset )GetList(data));
        }
예제 #8
0
 public static void Update(twf_TareasDataset dataSet)
 {
     Update(dataSet.twf_Tareas);
 }