Exemple #1
0
    public static Comn_Office GetComn_OfficeByID(int id)
    {
        Comn_Office            comn_Office            = new Comn_Office();
        SqlComn_OfficeProvider sqlComn_OfficeProvider = new SqlComn_OfficeProvider();

        comn_Office = sqlComn_OfficeProvider.GetComn_OfficeByID(id);
        return(comn_Office);
    }
Exemple #2
0
    public bool UpdateComn_Office(Comn_Office comn_Office)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("IEB_UpdateComn_Office", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Comn_OfficeID", SqlDbType.Int).Value        = comn_Office.Comn_OfficeID;
            cmd.Parameters.Add("@Comn_OfficeName", SqlDbType.NVarChar).Value = comn_Office.Comn_OfficeName;
            cmd.Parameters.Add("@Comm_OfficeTypeID", SqlDbType.Int).Value    = comn_Office.Comm_OfficeTypeID;
            cmd.Parameters.Add("@UpperLabelOfficeID", SqlDbType.Int).Value   = comn_Office.UpperLabelOfficeID;
            cmd.Parameters.Add("@Website", SqlDbType.NVarChar).Value         = comn_Office.Website;
            cmd.Parameters.Add("@Phone", SqlDbType.NVarChar).Value           = comn_Office.Phone;
            cmd.Parameters.Add("@Fax", SqlDbType.NVarChar).Value             = comn_Office.Fax;
            cmd.Parameters.Add("@Details", SqlDbType.NText).Value            = comn_Office.Details;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return(result == 1);
        }
    }
Exemple #3
0
 public Comn_Office GetComn_OfficeFromReader(IDataReader reader)
 {
     try
     {
         Comn_Office comn_Office = new Comn_Office
                                   (
             (int)reader["Comn_OfficeID"],
             reader["Comn_OfficeName"].ToString(),
             (int)reader["Comm_OfficeTypeID"],
             (int)reader["UpperLabelOfficeID"],
             reader["Website"].ToString(),
             reader["Phone"].ToString(),
             reader["Fax"].ToString(),
             reader["Details"].ToString()
                                   );
         return(comn_Office);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Exemple #4
0
    public static bool UpdateComn_Office(Comn_Office comn_Office)
    {
        SqlComn_OfficeProvider sqlComn_OfficeProvider = new SqlComn_OfficeProvider();

        return(sqlComn_OfficeProvider.UpdateComn_Office(comn_Office));
    }
Exemple #5
0
    public static int InsertComn_Office(Comn_Office comn_Office)
    {
        SqlComn_OfficeProvider sqlComn_OfficeProvider = new SqlComn_OfficeProvider();

        return(sqlComn_OfficeProvider.InsertComn_Office(comn_Office));
    }