示例#1
0
    public static Comn_Gegree GetComn_GegreeByID(int id)
    {
        Comn_Gegree            comn_Gegree            = new Comn_Gegree();
        SqlComn_GegreeProvider sqlComn_GegreeProvider = new SqlComn_GegreeProvider();

        comn_Gegree = sqlComn_GegreeProvider.GetComn_GegreeByID(id);
        return(comn_Gegree);
    }
示例#2
0
    public int InsertComn_Gegree(Comn_Gegree comn_Gegree)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_InsertComn_Gegree", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Comn_GegreeID", SqlDbType.Int).Direction    = ParameterDirection.Output;
            cmd.Parameters.Add("@Comn_GegreeName", SqlDbType.NVarChar).Value = comn_Gegree.Comn_GegreeName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@Comn_GegreeID"].Value);
        }
    }
示例#3
0
    public bool UpdateComn_Gegree(Comn_Gegree comn_Gegree)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_UpdateComn_Gegree", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Comn_GegreeID", SqlDbType.Int).Value        = comn_Gegree.Comn_GegreeID;
            cmd.Parameters.Add("@Comn_GegreeName", SqlDbType.NVarChar).Value = comn_Gegree.Comn_GegreeName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
示例#4
0
 public Comn_Gegree GetComn_GegreeFromReader(IDataReader reader)
 {
     try
     {
         Comn_Gegree comn_Gegree = new Comn_Gegree
                                   (
             (int)reader["Comn_GegreeID"],
             reader["Comn_GegreeName"].ToString()
                                   );
         return(comn_Gegree);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
示例#5
0
    public static bool UpdateComn_Gegree(Comn_Gegree comn_Gegree)
    {
        SqlComn_GegreeProvider sqlComn_GegreeProvider = new SqlComn_GegreeProvider();

        return(sqlComn_GegreeProvider.UpdateComn_Gegree(comn_Gegree));
    }
示例#6
0
    public static int InsertComn_Gegree(Comn_Gegree comn_Gegree)
    {
        SqlComn_GegreeProvider sqlComn_GegreeProvider = new SqlComn_GegreeProvider();

        return(sqlComn_GegreeProvider.InsertComn_Gegree(comn_Gegree));
    }