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); }
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); } }
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); } }
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); } }
public static bool UpdateComn_OfficeType(Comn_OfficeType comn_OfficeType) { SqlComn_OfficeTypeProvider sqlComn_OfficeTypeProvider = new SqlComn_OfficeTypeProvider(); return(sqlComn_OfficeTypeProvider.UpdateComn_OfficeType(comn_OfficeType)); }
public static int InsertComn_OfficeType(Comn_OfficeType comn_OfficeType) { SqlComn_OfficeTypeProvider sqlComn_OfficeTypeProvider = new SqlComn_OfficeTypeProvider(); return(sqlComn_OfficeTypeProvider.InsertComn_OfficeType(comn_OfficeType)); }