Exemple #1
0
    public static Comn_File GetComn_FileByID(int id)
    {
        Comn_File            comn_File            = new Comn_File();
        SqlComn_FileProvider sqlComn_FileProvider = new SqlComn_FileProvider();

        comn_File = sqlComn_FileProvider.GetComn_FileByID(id);
        return(comn_File);
    }
Exemple #2
0
    public bool UpdateComn_File(Comn_File comn_File)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_UpdateComn_File", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Comn_FileID", SqlDbType.Int).Value      = comn_File.Comn_FileID;
            cmd.Parameters.Add("@Comn_FileTypeID", SqlDbType.Int).Value  = comn_File.Comn_FileTypeID;
            cmd.Parameters.Add("@FileName", SqlDbType.NVarChar).Value    = comn_File.FileName;
            cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value          = comn_File.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value   = comn_File.AddedDate;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value        = comn_File.UpdatedBy;
            cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = comn_File.UpdatedDate;
            cmd.Parameters.Add("@Comn_RowStatusID", SqlDbType.Int).Value = comn_File.Comn_RowStatusID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
Exemple #3
0
 public Comn_File GetComn_FileFromReader(IDataReader reader)
 {
     try
     {
         Comn_File comn_File = new Comn_File
                               (
             (int)reader["Comn_FileID"],
             (int)reader["Comn_FileTypeID"],
             reader["FileName"].ToString(),
             (int)reader["AddedBy"],
             (DateTime)reader["AddedDate"],
             (int)reader["UpdatedBy"],
             (DateTime)reader["UpdatedDate"],
             (int)reader["Comn_RowStatusID"]
                               );
         return(comn_File);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Exemple #4
0
    public static bool UpdateComn_File(Comn_File comn_File)
    {
        SqlComn_FileProvider sqlComn_FileProvider = new SqlComn_FileProvider();

        return(sqlComn_FileProvider.UpdateComn_File(comn_File));
    }
Exemple #5
0
    public static int InsertComn_File(Comn_File comn_File)
    {
        SqlComn_FileProvider sqlComn_FileProvider = new SqlComn_FileProvider();

        return(sqlComn_FileProvider.InsertComn_File(comn_File));
    }