Ejemplo n.º 1
0
        public static bool Update(DOChonPhongVan ChonPhongVan)
        {
            try
            {
                string sql = "UPDATE BANG_CHON_PV SET "
                            + "NAME = @NAME "
                            + "WHERE ID = @ID";
                DatabaseFB db = DABase.getDatabase();
                DbCommand cmd = db.GetSQLStringCommand(sql);
                db.AddInParameter(cmd, "@ID", DbType.Int64, ChonPhongVan.getID());
                db.AddInParameter(cmd, "@NAME", DbType.String, ChonPhongVan.getName());
                int iCmd = db.ExecuteNonQuery(cmd);
                if (iCmd > 0)
                    return true;
                return false;
            }
            catch (Exception ex)
            {

                throw new Exception(ex.Message);
            }
        }
Ejemplo n.º 2
0
        public static bool Insert(DOChonPhongVan ChonPhongVan)
        {
            try
            {
                string sql = "INSERT INTO BANG_CHON_PV "
                            + "(ID,NAME) VALUES "
                            + "(@ID,@NAME)";
                DatabaseFB db = DABase.getDatabase();
                DbCommand cmd = db.GetSQLStringCommand(sql);
                db.AddInParameter(cmd, "@ID", DbType.Int64, ChonPhongVan.getID());
                db.AddInParameter(cmd, "@NAME", DbType.String, ChonPhongVan.getName());
                int iCmd = db.ExecuteNonQuery(cmd);
                if (iCmd > 0)
                    return true;
                return false;
            }
            catch (Exception ex)
            {

                throw new Exception(ex.Message);
            }
        }