示例#1
0
    public static Comn_OfficeType GetComn_OfficeTypeByID(int id)
    {
        Comn_OfficeType            comn_OfficeType            = new Comn_OfficeType();
        SqlComn_OfficeTypeProvider sqlComn_OfficeTypeProvider = new SqlComn_OfficeTypeProvider();

        comn_OfficeType = sqlComn_OfficeTypeProvider.GetComn_OfficeTypeByID(id);
        return(comn_OfficeType);
    }
示例#2
0
    public int InsertComn_OfficeType(Comn_OfficeType comn_OfficeType)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_InsertComn_OfficeType", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Comn_OfficeTypeID", SqlDbType.Int).Direction    = ParameterDirection.Output;
            cmd.Parameters.Add("@Comn_OfficeTypeName", SqlDbType.NVarChar).Value = comn_OfficeType.Comn_OfficeTypeName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return((int)cmd.Parameters["@Comn_OfficeTypeID"].Value);
        }
    }
示例#3
0
    public bool UpdateComn_OfficeType(Comn_OfficeType comn_OfficeType)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_UpdateComn_OfficeType", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Comn_OfficeTypeID", SqlDbType.Int).Value        = comn_OfficeType.Comn_OfficeTypeID;
            cmd.Parameters.Add("@Comn_OfficeTypeName", SqlDbType.NVarChar).Value = comn_OfficeType.Comn_OfficeTypeName;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
示例#4
0
 public Comn_OfficeType GetComn_OfficeTypeFromReader(IDataReader reader)
 {
     try
     {
         Comn_OfficeType comn_OfficeType = new Comn_OfficeType
                                           (
             (int)reader["Comn_OfficeTypeID"],
             reader["Comn_OfficeTypeName"].ToString()
                                           );
         return(comn_OfficeType);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
示例#5
0
    public static bool UpdateComn_OfficeType(Comn_OfficeType comn_OfficeType)
    {
        SqlComn_OfficeTypeProvider sqlComn_OfficeTypeProvider = new SqlComn_OfficeTypeProvider();

        return(sqlComn_OfficeTypeProvider.UpdateComn_OfficeType(comn_OfficeType));
    }
示例#6
0
    public static int InsertComn_OfficeType(Comn_OfficeType comn_OfficeType)
    {
        SqlComn_OfficeTypeProvider sqlComn_OfficeTypeProvider = new SqlComn_OfficeTypeProvider();

        return(sqlComn_OfficeTypeProvider.InsertComn_OfficeType(comn_OfficeType));
    }